Skip to content

Commit

Permalink
Run Python unit tests in GitHub action (#362)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Goerens <[email protected]>
  • Loading branch information
mgoerens authored Jul 8, 2024
1 parent 1c6cf35 commit 3c094bf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python Test

on:
pull_request:
paths:
# Only the precheck module currently provides unit tests
- 'scripts/src/precheck/*'

jobs:
enforce:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.x Part 1
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up Python 3.x Part 2
run: |
# set up python
python3 -m venv ve1
cd scripts
../ve1/bin/pip3 install -r requirements.txt
../ve1/bin/pip3 install .
cd ..
- name: Run pytest
run: |
pytest scripts/src/precheck/
6 changes: 4 additions & 2 deletions release/release_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
".github/workflows/nightly_test.yml",
".github/workflows/metrics.yml",
".github/workflows/codeql.yml",
".github/dependabot.yml"
".github/dependabot.yml",
".github/workflows/python-test.yml"
]
},
"stage": {
Expand All @@ -42,7 +43,8 @@
".github/workflows/version_check.yml",
".github/workflows/codeql.yml",
".github/workflows/check-locks-on-owners-submission.yml",
".github/dependabot.yml"
".github/dependabot.yml",
".github/workflows/python-test.yml"
]
}
}
Expand Down

0 comments on commit 3c094bf

Please sign in to comment.