Skip to content

Commit 5bb71ee

Browse files
authored
Merge pull request #495 from autoatml/fix_ci_workflow_test_duration_coverage
include pacemaker test-durations and coverage
2 parents 5283500 + b41b4d3 commit 5bb71ee

1 file changed

Lines changed: 42 additions & 3 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,30 @@ jobs:
6969
include-hidden-files: true
7070
path: ./.coverage
7171

72+
get-pacemaker-run:
73+
needs: build
74+
runs-on: ubuntu-latest
75+
outputs:
76+
run_id: ${{ steps.get-run.outputs.run_id }}
77+
steps:
78+
- name: Get latest successful Pacemaker run ID
79+
id: get-run
80+
run: |
81+
RUN_ID=$(gh run list \
82+
--repo ${{ github.repository }} \
83+
--workflow="Testing Pacemaker (Python 3.10)" \
84+
--branch=main \
85+
--status=success \
86+
--limit=1 \
87+
--json databaseId \
88+
-q '.[0].databaseId')
89+
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
90+
env:
91+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
7293
commit-durations:
7394
if: github.repository_owner == 'autoatml' && github.ref == 'refs/heads/main'
74-
needs: build
95+
needs: [build, get-pacemaker-run]
7596
runs-on: ubuntu-latest
7697
defaults:
7798
run:
@@ -102,6 +123,13 @@ jobs:
102123
with:
103124
pattern: test-durations-*
104125

126+
- name: Download Pacemaker test duration artifacts
127+
continue-on-error: true
128+
uses: actions/download-artifact@v4
129+
with:
130+
pattern: test-durations-pacemaker
131+
run-id: ${{ needs.get-pacemaker-run.outputs.run_id }}
132+
github-token: ${{ secrets.GITHUB_TOKEN }}
105133

106134
- name: Compute average of test durations
107135
run: |
@@ -123,22 +151,33 @@ jobs:
123151
base: main
124152

125153
coverage:
126-
needs: build
154+
needs: [build, get-pacemaker-run]
127155
runs-on: ubuntu-latest
128156
steps:
129-
- uses: actions/checkout@v3
157+
- uses: actions/checkout@v4
130158
- name: Set up Python 3.10
131159
uses: actions/setup-python@v4
132160
with:
133161
python-version: '3.10'
162+
134163
- name: Install Coverage
135164
run: |
136165
python -m pip install coverage[toml]
166+
137167
- name: Download coverage artifacts
138168
continue-on-error: true
139169
uses: actions/download-artifact@v4
140170
with:
141171
pattern: coverage-*
172+
173+
- name: Download Pacemaker coverage artifacts
174+
continue-on-error: true
175+
uses: actions/download-artifact@v4
176+
with:
177+
pattern: coverage-pacemaker
178+
run-id: ${{ needs.get-pacemaker-run.outputs.run_id }}
179+
github-token: ${{ secrets.GITHUB_TOKEN }}
180+
142181
- name: Run coverage
143182
continue-on-error: true
144183
run: |

0 commit comments

Comments
 (0)