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 |
String |
True |
|
library-name |
Name of the library, for example |
String |
True |
|
repository-name |
Name of the repository, for example |
String |
True |
|
main-python-version |
Python version used for the workflow, unless specified otherwise. |
String |
False |
|
build-wheelhouse-versions |
List of Python versions as a JSON list. |
String |
False |
|
scade-tests-versions |
List of Ansys SCADE versions as a JSON list. |
String |
True |
|
python-tests-os |
List of OS versions as a JSON list. |
String |
True |
|
python-tests-versions |
List of Python versions as a JSON list. |
String |
False |
|
sphinx-opts |
Set of options to pass to the |
String |
False |
|
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 Note: The returned value is always |
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 |
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 |
||
pr-name |
check-actions-security |
|
labeler |
pr-name |
|
changelog-fragment |
labeler |
|
code-style |
pr-name |
|
doc-style |
pr-name |
|
check-vulnerabilities |
pr-name |
|
update-changelog |
check-actions-security |
|
build-wheelhouse |
code-style |
|
scade-tests |
build-wheelhouse |
|
python-tests (skipped by default) |
build-wheelhouse |
|
doc-build |
doc-style |
|
doc-deploy-pr |
doc-build |
|
build-library |
python-tests, scade-tests, doc-build, check-vulnerabilities |
|
release |
build-library, update-changelog |
|
doc-deploy-dev |
build-library |
|
doc-deploy-stable |
release |