Skip to content

Commit

Permalink
Add pytest for GUI only
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneVoss committed Jan 5, 2024
1 parent d842e1e commit 2764b30
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,50 @@ jobs:
path: ./doc/html
if-no-files-found: ignore

Pytest:
runs-on: ubuntu-latest
strategy:
matrix:
# Add multiple Python versions here to run tests on new(er) versions.
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Build and install
run: |
python -m pip install --upgrade pip
# Install with -e (in editable mode) to allow the tracking of the test coverage
pip install -e .
- name: Analyse the code with pytest
run: |
# Run the actual testing
pytest -v -k test_gui --cov=modelviewer --cov=loadscompare --junitxml=testresult.xml
# Create some reports
coverage report
coverage xml -o coverage.xml
# Put the html into a 2nd-level sub-folder and use 1st-level subfolder for uploading to maintain folder
coverage html --directory ./coverage/coverage
- name: Upload HTML coverage report as an artifact
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./coverage
if-no-files-found: ignore
- name: Upload HTML coverage report for pages
# This is not a normal artifact but one that can be deployed to the GitHub pages in the next step
uses: actions/upload-pages-artifact@v3
with:
name: github-pages # This name may not be changed according to the documentation
path: ./coverage
if-no-files-found: ignore


deploy-pages:
# Add a dependency to the build job
needs: Jupyter
needs: [Jupyter, Pytest]

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
Expand Down

0 comments on commit 2764b30

Please sign in to comment.