Prepare new Version #11
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 workflow will install and then lint the code with Flake8 and Pylint. | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Regression Tests | |
on: | |
push: | |
branches: ['master', 'devel'] | |
pull_request: | |
branches: '*' | |
jobs: | |
Pytest: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Add multiple Python versions here to run tests on new(er) versions. | |
python-version: ["3.10"] | |
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 --cov=panelaero --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: Pytest | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup GitHub Pages | |
uses: actions/configure-pages@v4 | |
- name: Deploy to Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |