Skip to content

Commit

Permalink
collect coverage from all python versions in parallel
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Kario <hkario@redhat.com>
  • Loading branch information
tomato42 committed Jul 23, 2024
1 parent 3040d08 commit ccc6aa9
Showing 1 changed file with 23 additions and 41 deletions.
64 changes: 23 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ jobs:
- name: Display installed python package versions
run: |
pip list || :
- name: Install pytest
- name: Install test requirements
run: |
pip install pytest
pip install pytest coverage coveralls
- name: Install build dependencies
run: |
pip install -r requirements.txt
Expand All @@ -120,47 +120,29 @@ jobs:
pip list || :
- name: Run unit tests
run: |
pytest
coverage run --branch -m pytest
- name: Print collected coverage
run: |
coverage report
- name: Publish coverage to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.name }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
run: |
coveralls
coveralls:
name: Indicate completion to coveralls
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:

- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Display installed python package versions
run: |
pip list || :
- name: Install coverage
run: |
pip install coverage
- name: Install pytest
run: |
pip install pytest
- name: Install build dependencies
run: |
pip install -r requirements.txt
- name: Display installed python package versions
run: |
pip list || :
- name: Run unit tests with coverage
- name: Install coveralls
run: |
coverage run -m pytest
- name: Report Coveralls
run: curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls
pip3 install --upgrade coveralls
- name: Report to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: coveralls --finish

0 comments on commit ccc6aa9

Please sign in to comment.