From c6d7734dd1b808046420bb7b167f6ba9510791c8 Mon Sep 17 00:00:00 2001 From: Martin Morgenstern Date: Wed, 20 Mar 2024 09:25:43 +0100 Subject: [PATCH] Add GitHub workflow for pytest unit tests Signed-off-by: Martin Morgenstern --- .github/workflows/test-python.yml | 20 ++++++++++++++++++++ Tests/README.md | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-python.yml diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml new file mode 100644 index 000000000..5c8e9f94c --- /dev/null +++ b/.github/workflows/test-python.yml @@ -0,0 +1,20 @@ +--- +name: Run Python unit and regression tests + +"on": + push: + paths: + - '**.py' + - .github/workflows/test-python.yml + +jobs: + lint-python-syntax: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - run: pip3 install --upgrade pip setuptools + - run: pip3 install -r Tests/test-requirements.txt + - run: pytest Tests diff --git a/Tests/README.md b/Tests/README.md index ab6fee623..699b7f23f 100644 --- a/Tests/README.md +++ b/Tests/README.md @@ -114,4 +114,5 @@ It needs to be run in two cases: Note: The Python version used for running `pip-compile` should be consistent. The currently used version is documented in the header of the `requirements.txt`. It should match the -version used in the Docker image (see [Dockerfile](Dockerfile)). +version used in the Docker image (see [Dockerfile](Dockerfile)) and in our GitHub +workflows (`lint-python.yml` and `test-python.yml` in `.github/workflows`).