Skip to content

Commit

Permalink
Add additional workflows; bump coverage threshold to 80%
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Nov 4, 2022
1 parent 964f17a commit a83ab80
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Code coverage

on:
push:
branches:
- main
- 'stable/**'
pull_request:
branches:
- main
- 'stable/**'

jobs:
coverage:
name: coverage (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox coveragepy-lcov
- name: Run coverage
run: |
eval $(ssh-agent -s)
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
tox -e coverage
- name: Convert to lcov
run: coveragepy-lcov --output_file_path coveralls.info
- name: Upload report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coveralls.info
5 changes: 4 additions & 1 deletion .github/workflows/test_latest_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
python-version: ["3.7", "3.10"]
include:
- os: macos-latest
python-version: "3.7"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ commands =
coverage3 run --source circuit_knitting_toolbox --parallel-mode -m pytest test/ {posargs}
coverage3 combine
coverage3 html
coverage3 report --fail-under=50
coverage3 report --fail-under=80

[testenv:docs]
deps =
Expand Down

0 comments on commit a83ab80

Please sign in to comment.