Skip to content

Commit

Permalink
Break tests and codecov workflow in 2
Browse files Browse the repository at this point in the history
The idea is to have the status badge report if the tests are passing,
without considering codecov since it frequently fails due to some
network hickup that makes the report upload to fail.

This also makes things a bit more compartimentalized.
  • Loading branch information
alan-barzilay committed Nov 8, 2023
1 parent e2c0f64 commit eabd8b9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CodeCov
on:
workflow_run:
workflows: [Tests]
types: [completed]

jobs:
coverage_report:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage docopt yarg requests
- name: Calculate coverage
run: coverage run --source=pipreqs -m unittest discover

- name: Create XML report
run: coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true
26 changes: 1 addition & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests and Codecov
name: Tests
on:
push:
pull_request:
Expand Down Expand Up @@ -28,27 +28,3 @@ jobs:
- name: Test with tox
run: tox

coverage_report:
needs: run_tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage docopt yarg requests
- name: Calculate coverage
run: coverage run --source=pipreqs -m unittest discover

- name: Create XML report
run: coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true

0 comments on commit eabd8b9

Please sign in to comment.