Skip to content

Commit

Permalink
BUG: improve coveralls call
Browse files Browse the repository at this point in the history
Improve the coveralls call by:
- moving the installation up top,
- using the parallel flag, and
- explicitly declare the repo token.
  • Loading branch information
aburrell committed Apr 2, 2024
1 parent 03d481b commit d9f7aae
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,33 @@ jobs:
pip install .[test]
bash requirements.extra ${{ matrix.install-extras }}
- name: Test PEP8 compliance
run: flake8 . --count --show-source --statistics

- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics

- name: Run unit and integration tests
run: coverage run --rcfile=pyproject.toml -m unittest discover

- name: Report Coveralls (Linux)
- name: Install Coveralls Reporter (Linux)
if: startsWith(matrix.os, 'ubuntu')
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls
run: curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz

- name: Report Coveralls (Windows)
- name: Install Coveralls Reporter (Windows)
if: startsWith(matrix.os, 'windows')
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: curl -L https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe -o coveralls.exe

- name: Report Coveralls (macOS)
if: startsWith(matrix.os, 'macos')
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
brew tap coverallsapp/coveralls --quiet
brew install coveralls --quiet
coveralls
- name: Test PEP8 compliance
run: flake8 . --count --show-source --statistics

- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics

- name: Run unit and integration tests
run: coverage run --rcfile=pyproject.toml -m unittest discover

- name: Report test coverage to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls report --parallel --repo-token=${{ secrets.COVERALLS_REPO_TOKEN }}

finish:
name: Finish Coverage Analysis
Expand All @@ -86,6 +81,5 @@ jobs:
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -k https://coveralls.io/webhook?repo_token=$GITHUB_TOKEN -d "payload[build_num]=$BUILD_NUMBER&payload[status]=done"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls done

0 comments on commit d9f7aae

Please sign in to comment.