-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
145 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
tests: | ||
name: "Run tests basic example" | ||
runs-on: [self-hosted, 'SCADE'] | ||
steps: | ||
- name: "Run the tests for a given version of Ansys SCADE" | ||
uses: ansys/scade-actions/scade-tests-pytest@{{ version }} | ||
with: | ||
scade-version: '23.2' | ||
pytest-extra-args: "--cov=ansys --cov-report=term --cov-branch --cov-report=html:.cov/html" | ||
checkout: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# action derived from ansys/actions/tests-pytest | ||
name: > | ||
Tests pytest action | ||
description: > | ||
Run a test suite using `pytest <https://docs.pytest.org/en/stable/>`_. | ||
inputs: | ||
|
||
scade-version: | ||
description: > | ||
SCADE version used for installing and running ``pytest``. | ||
For example, use ``'24.1'`` for Ansys SCADE 2024 R1. | ||
required: true | ||
|
||
# Optional inputs | ||
library-dir: | ||
description: > | ||
Directory of the library to test. | ||
default: '.' | ||
required: false | ||
|
||
pytest-markers: | ||
description: > | ||
Set of `pytest markers | ||
<https://docs.pytest.org/en/stable/example/markers.html>`_ in the form of | ||
a string. These markers are used to discretize tests when running the test | ||
session. | ||
default: '' | ||
required: false | ||
|
||
pytest-extra-args: | ||
description: > | ||
Set of additional ``pytest`` arguments in the form of a string. | ||
default: '' | ||
required: false | ||
|
||
pytest-postargs: | ||
description: > | ||
Directory of the test suite and the level of verbosity. | ||
default: 'tests -vv' | ||
required: false | ||
|
||
checkout: | ||
description: > | ||
Whether to clone the repository in the CI/CD machine. | ||
default: 'true' | ||
required: false | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: "Retrieve SCADE installation directory" | ||
uses: ./get-scade-dir | ||
id: get-scade-dir | ||
with: | ||
scade-version: ${{ inputs.scade-version }} | ||
|
||
- name: "Retrieve SCADE Python interpreter" | ||
uses: ./get-scade-python | ||
id: get-scade-python | ||
with: | ||
scade-dir: ${{ steps.get-scade-dir.outputs.scade-directory }} | ||
|
||
- name: "Create Python virtual environment" | ||
uses: ./create-scade-venv | ||
id: create-scade-venv | ||
with: | ||
python-dir: ${{ steps.get-scade-python.outputs.python-dir }} | ||
target-dir: '.venvs' | ||
target-name: ${{ steps.get-scade-python.outputs.python-name }} | ||
|
||
# redundant with ./tests-pytest | ||
# - name: Check Python and install dependencies | ||
# shell: cmd | ||
# run: | | ||
# echo "Activate the environment ${{ steps.create-scade-venv.outputs.scripts-dir }}" | ||
# echo PYTHON_DIR=${{ steps.create-scade-venv.outputs.scripts-dir }}>> %GITHUB_ENV% | ||
# | ||
# - name: Check Python | ||
# shell: cmd | ||
# run: | | ||
# call %PYTHON_DIR%\activate.bat | ||
# python --version | ||
# %PYTHON_DIR%\python.exe -m pip install -U pip | ||
# %PYTHON_DIR%\python.exe -m pip install ${{ inputs.library-dir }}[tests] | ||
|
||
- name: "Run the tests" | ||
uses: ./tests-pytest | ||
with: | ||
python-dir: ${{ steps.create-scade-venv.outputs.scripts-dir }} | ||
library-dir: ${{ inputs.library-dir }} | ||
pytest-markers: ${{ inputs.pytest-markers }} | ||
pytest-extra-args: ${{ inputs.pytest-extra-args }} | ||
pytest-postargs: ${{ inputs.pytest-postargs }} | ||
checkout: ${{ checkout }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters