Skip to content

Commit

Permalink
ci: Report coverage to Codecov without token (#1628)
Browse files Browse the repository at this point in the history
* Report coverage to Codecov without using a secret Codecov token
   - c.f. codecov/codecov-action#29 (comment)
   - Effectively reverts Codecov logic part of PR #1622
* Ensure codecov/codecov-action v2 used
   - Amends PR #1623
  • Loading branch information
matthewfeickert authored Oct 12, 2021
1 parent e47b1cf commit 54b44ad
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,8 @@ jobs:
run: |
python -m pytest -r sx --ignore tests/benchmarks/ --ignore tests/contrib --ignore tests/test_notebooks.py
- name: Report core project coverage with Codecov (maintainers)
# Run on all events except schedule if PR comes from maintainers
if: github.repository == 'scikit-hep/pyhf' && github.event_name != 'schedule' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests

- name: Report core project coverage with Codecov (contributors)
# Run on pull_request events if PR comes from contributor fork
if: github.repository != 'scikit-hep/pyhf' && github.event_name == 'pull_request' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
- name: Report core project coverage with Codecov
if: github.event_name != 'schedule' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
Expand All @@ -70,18 +60,8 @@ jobs:
run: |
python -m pytest -r sx tests/contrib --mpl --mpl-baseline-path tests/contrib/baseline
- name: Report contrib coverage with Codecov (maintainers)
# Run on all events except schedule if PR comes from maintainers
if: github.repository == 'scikit-hep/pyhf' && github.event_name != 'schedule' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: contrib

- name: Report contrib coverage with Codecov (contributors)
# Run on pull_request events if PR comes from contributor fork
if: github.repository != 'scikit-hep/pyhf' && github.event_name == 'pull_request' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
- name: Report contrib coverage with Codecov
if: github.event_name != 'schedule' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
Expand Down

0 comments on commit 54b44ad

Please sign in to comment.