-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bvandekerkhof <[email protected]>
- Loading branch information
1 parent
77d33bf
commit e0c5a6f
Showing
1 changed file
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Run Pytest | ||
on: | ||
- push | ||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11" ] | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install pytest-cov | ||
pip install . | ||
- name: Unit test with pytest | ||
run: | | ||
pytest --cov-report=xml --junitxml=pytest_junit.xml | ||
- name: Fix code coverage paths | ||
run: | | ||
sed -i 's/\/opt\/hostedtoolcache\/Python\/.*\/site-packages/src/g' coverage.xml | ||
sed -i 's/opt\/hostedtoolcache\/Python\/.*\/site-packages/src/g' coverage.xml | ||
sed -i 's/\.opt\.hostedtoolcache\.Python\..*\.site-packages\.pyelq/src/g' coverage.xml | ||
sed -i 's/opt\.hostedtoolcache\.Python\..*\.site-packages\.pyelq/src/g' coverage.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
- name: Upload coverage xml results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage_xml | ||
path: coverage.xml | ||
if: ${{ always() }} | ||
- name: Upload coverage junitxml results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest_junitxml | ||
path: pytest_junit.xml |