Skip to content

Commit

Permalink
point CI to codecov staging
Browse files Browse the repository at this point in the history
  • Loading branch information
giovanni-guidini committed Dec 7, 2023
1 parent dcc70cf commit 0b9c0a0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 14 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ jobs:
with:
python-version: '3.10.10'
- name: Install requirements
run: pip install -r requirements.txt
run: |
pip install -r requirements.txt
pip install codecov-cli
- name: Run tests and collect coverage (with labels)
run: |
python -m pytest ${{ matrix.app }}/** --cov=./${{ matrix.app }} --cov-report="xml:.artifacts/${{ matrix.app }}.coverage.xml" --cov-context=test
coverage json -o .artifacts/${{ matrix.app }}.coverage.json --show-contexts
- name: Upload to codecov
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_STAGING_TOKEN }}
flags: ${{ matrix.app }}
files: .artifacts/${{ matrix.app }}.coverage.xml
verbose: true
Expand All @@ -41,11 +43,8 @@ jobs:
rm .artifacts/core.coverage.xml
- name: Upload to codecov - special case test ATS
if: ${{ matrix.app == 'core' }}
uses: codecov/codecov-action@v4-beta
run: |
codecovcli --url=${{ secrets.CODECOV_STAGING_URL }} do-upload --flag smart-tests --plugin compress-pycoverage --file .artifacts/core.coverage.codecov.json --token=${CODECOV_TOKEN}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: .artifacts/core.coverage.codecov.json
flags: smart-tests
plugins: compress-pycoverage
CODECOV_TOKEN: ${{ secrets.CODECOV_STAGING_TOKEN }}
continue-on-error: true
12 changes: 6 additions & 6 deletions .github/workflows/iterative_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
# We need the setup to collect the list of tests properly
- name: Download Codecov CLI
run: |
pip install codecov-cli==0.4.0
pip install codecov-cli==0.4.1
# Creates the commit and report objects in codecov
- name: Codecov startup
run: |
codecovcli create-commit
codecovcli create-report
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_STAGING_TOKEN }}
# Sends static analysis information to codecov
- name: Static Analysis
run: |
Expand All @@ -46,8 +46,8 @@ jobs:
--folders-to-exclude static \
--folders-to-exclude bin
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_STATIC_TOKEN: ${{ secrets.STATIC_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_STAGING_TOKEN }}
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STAGING_STATIC_TOKEN }}
- name: Install requirements
run: pip install -r requirements.txt
# Run label analysis in dry mode to get the list of tests to run
Expand Down Expand Up @@ -86,8 +86,8 @@ jobs:
exit 1
fi
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_STATIC_TOKEN: ${{ secrets.STATIC_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_STAGING_TOKEN }}
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STAGING_STATIC_TOKEN }}
debug:
runs-on: ubuntu-latest
needs: coverage-ats
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/iterative_testing_reqs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Reqs for iterative testing

on:
push:

jobs:
prep-commit-for-ats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: download codecov cli
run: |
pip install codecov-cli==0.4.1
- name: Codecov startup
run: |
codecovcli --url=${{ secrets.CODECOV_STAGING_URL }} create-commit
codecovcli --url=${{ secrets.CODECOV_STAGING_URL }} create-report
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_STAGING_TOKEN }}
# Sends static analysis information to codecov
# This is used as an input in Codecov Automated Test Selection.
# It's necessary so we can use this commit as the BASE for comparison
- name: Static Analysis
run: |
codecovcli --url=${{ secrets.CODECOV_STAGING_URL }} static-analysis --token=${CODECOV_STATIC_TOKEN} \
--folders-to-exclude .artifacts \
--folders-to-exclude .github \
--folders-to-exclude .venv
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_STAGING_TOKEN }}
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STAGING_STATIC_TOKEN }}

0 comments on commit 0b9c0a0

Please sign in to comment.