-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
67 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,67 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
name: Running tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
lint_flake8: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
flake8 . --count --show-source --statistics --max-line-length=127 --ignore=E402,W503,E203 | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: read | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Search for severe code errors with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
pip install flake8 | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --max-line-length=127 | ||
- name: provision-with-micromamba | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: environment.yml | ||
environment-name: leakpro | ||
cache-downloads: true | ||
- name: Test with pytest | ||
shell: bash -l {0} | ||
run: | | ||
micromamba activate leakpro | ||
micromamba install pytest pytest-cov | ||
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=paseos leakpro/tests/ | tee pytest-coverage.txt | ||
- name: Pytest coverage comment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
if: github.event_name == 'pull_request' | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
title: Coverage Report | ||
badge-title: Overall Coverage | ||
hide-badge: false | ||
hide-report: false | ||
create-new-comment: false | ||
hide-comment: false | ||
report-only-changed-files: false | ||
junitxml-path: ./pytest.xml |