GitHub Workflow for SCADE Python Extensions#

You can use the GitHub workflow for SCADE Python Extensions to develop a SCADE Python library, for example ansys-scade-apitools. You can also use it to create an extension, such as a code generator wrapper or a SCADE IDE Python custom extension.

The workflow accepts inputs to specify repository properties used in jobs and options to deactivate a given job.

Inputs#

Name

Description

Type

Required

Default

documentation-cname

Documentation’s CNAME, for example apitools.scade.docs.pyansys.com.

String

True

library-name

Name of the library, for example ansys-scade-apitools.

String

True

repository-name

Name of the repository, for example ansys/scade-apitools.

String

True

main-python-version

Python version used for the workflow, unless specified otherwise.

String

False

"3.12"

build-wheelhouse-versions

List of Python versions as a JSON list.

String

False

"['3.10']"

scade-tests-versions

List of Ansys SCADE versions as a JSON list.

String

True

"['25.1']"

python-tests-os

List of OS versions as a JSON list.

String

True

"['ubuntu-latest']"

python-tests-versions

List of Python versions as a JSON list.

String

False

"['3.10']"

sphinx-opts

Set of options to pass to the Sphinx builder.

String

False

"-j auto -W --keep-going"

Note

A Boolean dry-test input, false by default, verifies the workflow configuration. The jobs log a message instead of executing their actions.

Outputs#

Name

Description

to-release

Returns true if the public release action should be executed at the end of the workflow; otherwise, it returns false.

Note: The returned value is always false for private repositories.

Secrets#

Name

Description

PYANSYS_CI_BOT_TOKEN

Used to perform a git commit and push.

PYANSYS_CI_BOT_USERNAME

Defines the user for a git commit and push.

PYANSYS_CI_BOT_EMAIL

Defines the email for a git commit and push.

CODECOV_TOKEN

Used to upload coverage reports to Codecov.

PYANSYS_PYPI_PRIVATE_PAT

Used to release library artifacts to the PyAnsys private index. It addresses private repositories only.

Permissions#

Some workflow jobs require read or write permissions.

Name

Permission

Jobs

attestations

write

build-wheelhouse, build-library

contents

read

labeler, build-wheelhouse, build-library

write

changelog-fragment, update-changelog, doc-deploy-pr

id-token

write

build-wheelhouse, build-library, release

pull-requests

write

build-wheelhouse, build-library, release

Control#

The workflow defines an optional Boolean input for each job to control its activation. This input is named skip-<job-name>, for example, skip-build-wheelhouse. The default value is false.

Example#

dry-test:
  uses: ansys/scade-actions/.github/workflows/ci_cd_python_extensions.yml@main
  permissions:
    attestations: write
    contents: write
    id-token: write
    pull-requests: write
  with:
    documentation-cname: 'apitools.scade.docs.pyansys.com'
    library-name: 'ansys-scade-apitools'
    repository-name: 'scade-apitools'
    # actions not executed
    dry-test: true
  secrets: inherit

Jobs#

The following table summarizes the jobs, their dependencies, and the actions that are used. For more information, see the workflow itself: .github/workflows/scade-ext-workflow.yml.

Note

The table does not list common actions such as checkout or download-artifact.

Job

Dependencies

Actions

check-actions-security

ansys/actions/check-actions-security

pr-name

check-actions-security

ansys/actions/check-pr-title

labeler

pr-name

micnncim/action-label-syncer

actions/labeler

changelog-fragment

labeler

ansys/actions/doc-changelog

code-style

pr-name

ansys/actions/code-style

doc-style

pr-name

ansys/actions/doc-style

check-vulnerabilities

pr-name

ansys/actions/check-vulnerabilities

update-changelog

check-actions-security

ansys/actions/doc-deploy-changelog

build-wheelhouse

code-style

ansys/actions/build-wheelhouse

scade-tests

build-wheelhouse

ansys/scade-actions/scade-tests-pytest

codecov/codecov-action

python-tests (skipped by default)

build-wheelhouse

ansys/actions/tests-pytest

doc-build

doc-style

ansys/actions/doc-build

doc-deploy-pr

doc-build

ansys/actions/doc-deploy-pr

build-library

python-tests, scade-tests, doc-build, check-vulnerabilities

ansys/actions/build-library

release

build-library, update-changelog

ansys/actions/release-pypi-private

ansys/actions/release-github

doc-deploy-dev

build-library

ansys/actions/doc-deploy-dev

doc-deploy-stable

release

ansys/actions/doc-deploy-stable