Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit ab27ada

Browse files
Aggregate the test results files in CI (#507)
1 parent 14741f0 commit ab27ada

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ jobs:
7676
pip install -r tests/requirements.txt
7777
- name: Test with pytest
7878
run: |
79-
pytest --cov --junitxml=junit.xml
79+
pytest --cov --junitxml=${{matrix.python-version}}junit.xml
8080
- name: Dogfooding codecov-cli
8181
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
8282
run: |
8383
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
8484
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
85+
- name: Upload artifacts for test-results-processing
86+
if: ${{ always() }}
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: ${{matrix.python-version}}junit.xml
90+
path: ${{matrix.python-version}}junit.xml
8591

8692
static-analysis:
8793
runs-on: ubuntu-latest
@@ -131,38 +137,31 @@ jobs:
131137
run: |
132138
codecovcli --codecov-yml-path=codecov.yml do-upload --plugin pycoverage --plugin compress-pycoverage --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --flag smart-labels
133139
134-
test-process-test-results-cmd:
140+
process-test-results:
141+
if: ${{ always() }}
142+
needs: build-test-upload
135143
runs-on: ubuntu-latest
136-
permissions:
137-
pull-requests: write
138-
strategy:
139-
fail-fast: false
140-
matrix:
141-
include:
142-
- python-version: "3.12"
143-
- python-version: "3.11"
144-
- python-version: "3.10"
145-
- python-version: "3.9"
146-
- python-version: "3.8"
147144
steps:
148-
- uses: actions/checkout@v4
149-
with:
150-
submodules: true
151-
fetch-depth: 2
152-
- name: Set up Python ${{matrix.python-version}}
153-
uses: actions/setup-python@v5
154-
with:
155-
python-version: "${{matrix.python-version}}"
156-
- name: Install dependencies
157-
run: |
158-
python -m pip install --upgrade pip
159-
pip install -r requirements.txt
160-
python -m pip install -e .
161-
pip install -r tests/requirements.txt
162-
- name: Test with pytest
163-
run: |
164-
pytest --cov --junitxml=junit.xml
165-
- name: Dogfooding codecov-cli
166-
if: ${{ !cancelled() }}
167-
run: |
168-
codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }}
145+
- uses: actions/checkout@v4
146+
with:
147+
submodules: true
148+
fetch-depth: 2
149+
- uses: actions/setup-python@v5
150+
with:
151+
python-version: "3.12"
152+
- name: Install dependencies for Dogfooding
153+
run: |
154+
python -m pip install --upgrade pip
155+
pip install -r requirements.txt
156+
python -m pip install -e .
157+
pip install -r tests/requirements.txt
158+
- name: Download all test results
159+
uses: actions/download-artifact@v4
160+
with:
161+
pattern: "*junit.xml"
162+
path: "test_results"
163+
merge-multiple: true
164+
- name: Dogfooding codecov-cli
165+
if: ${{ !cancelled() }}
166+
run: |
167+
codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} --dir test_results

0 commit comments

Comments
 (0)