Skip to content

Commit

Permalink
Extract jobs of coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Jun 10, 2023
1 parent c173fac commit a968907
Showing 1 changed file with 72 additions and 5 deletions.
77 changes: 72 additions & 5 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,80 @@ jobs:

- name: Run tests
run: |
tox -e cov
tox -e py
# tox -e cov -- --discord-verbose=0 # reduce verbosity level of summary that send to discord
- name: Upload coverage report
run-coverage:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
timeout-minutes: 20
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- name: Setup env
run: echo "COVERAGE_FILE=.coverage_${{ matrix.os }}_${{ matrix.python-version }} " >> $GITHUB_ENV

- name: Install dependencies
run: make setup-ci

- name: Run tests
run: tox -e cov

- run: ls -a

- uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage_*

upload-coverage:
needs: run-coverage
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: coverage
path: artifact

- name: List artifacts
working-directory: artifact
run: |
python -m pip install --upgrade --disable-pip-version-check coveralls tomli
coveralls --service=github
set -x
pwd
ls -alR
- name: Install packages
run: python -m pip install --upgrade --disable-pip-version-check coveralls tomli

- name: Combine coverage reports
run: |
coverage combine artifact/.coverage_*
ls -alR
- name: Upload coverage report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
run: coveralls --service=github

0 comments on commit a968907

Please sign in to comment.