Skip to content

Commit

Permalink
WIP: try new codecov strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Gui-FernandesBR committed Dec 17, 2023
1 parent a491ecd commit 5d62759
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 29 deletions.
61 changes: 34 additions & 27 deletions .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ jobs:
run: pip install -r requirements-tests.txt
- name: Run pytest (Unit Tests)
run: pytest -k "unit" --cov=rocketpy --cov-report=xml
- name: Codecov upload
uses: ./.github/workflows/upload-to-codecov.yml
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v2
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
os: ${{ matrix.os }}
python: ${{ matrix.python-version }}
name: coverage-build-and-unit
path: path/to/your/coverage/report

Acceptance:
needs: Build_and_Unit
Expand All @@ -58,12 +57,11 @@ jobs:
run: pip install -r requirements-tests.txt
- name: Run pytest (Acceptance Tests)
run: pytest --cov=rocketpy --cov-report=xml
- name: Codecov upload
uses: ./.github/workflows/upload-to-codecov.yml
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v2
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
os: ${{ matrix.os }}
python: ${{ matrix.python-version }}
name: coverage-build-and-unit
path: path/to/your/coverage/report

Integration:
needs: Build_and_Unit
Expand All @@ -80,13 +78,11 @@ jobs:
run: pip install -r requirements-tests.txt
- name: Run pytest (Integration Tests)
run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml
- name: Codecov upload
uses: ./.github/workflows/upload-to-codecov.yml
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v2
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
os: ${{ matrix.os }}
python: ${{ matrix.python-version }}

name: coverage-build-and-unit
path: path/to/your/coverage/report
Doc:
needs: Build_and_Unit
runs-on: ${{ matrix.os }}
Expand All @@ -104,13 +100,11 @@ jobs:
run: |
cd rocketpy
pytest --doctest-modules --cov=rocketpy --cov-report=xml
- name: Codecov upload
uses: ./.github/workflows/upload-to-codecov.yml
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v2
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
os: ${{ matrix.os }}
python: ${{ matrix.python-version }}

name: coverage-build-and-unit
path: path/to/your/coverage/report
Slow:
needs: [Acceptance, Integration, Doc]
runs-on: ${{ matrix.os }}
Expand All @@ -128,9 +122,22 @@ jobs:
if: github.ref == 'refs/heads/master'
run: |
pytest -m slow --runslow --cov=rocketpy --cov-report=xml
- name: Codecov upload
uses: ./.github/workflows/upload-to-codecov.yml
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v2
with:
name: coverage-build-and-unit
path: path/to/your/coverage/report

CodecovUpload:
if: always()
needs: [Build_and_Unit, Acceptance, Integration, Doc, Slow]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all coverage reports
uses: actions/download-artifact@v2
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
os: ${{ matrix.os }}
python: ${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
files: ./path/to/downloaded/coverage/reports/*
3 changes: 1 addition & 2 deletions .github/workflows/upload-to-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
with:
token: ${{ inputs.codecov_token }}
directory: ./coverage/reports/
env_vars: ${{ inputs.os }}, ${{ inputs.python }}
fail_ci_if_error: false
env_vars: OS,PYTHON
files: ./coverage.xml, ./rocketpy/coverage.xml
flags: unittests
name: codecov-umbrella
Expand Down

0 comments on commit 5d62759

Please sign in to comment.