Skip to content

Commit 9050197

Browse files
committed
CI(workflows): Increase job timeouts and improve nightly workflow control
1 parent 61f4e9a commit 9050197

9 files changed

Lines changed: 109 additions & 35 deletions

File tree

.github/workflows/buildmgr.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ on:
3232
types: [ published ]
3333

3434
concurrency:
35-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
35+
group: buildmgr-${{ github.ref }}-${{ github.event_name }}
3636
cancel-in-progress: true
3737

3838
permissions:
@@ -57,7 +57,7 @@ jobs:
5757
name: build (${{ matrix.runs_on }}, ${{ matrix.arch }})
5858
needs: [ setup, matrix_prep ]
5959
runs-on: ${{ matrix.runs_on }}
60-
timeout-minutes: 15
60+
timeout-minutes: 25
6161
strategy:
6262
fail-fast: true
6363
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -121,7 +121,7 @@ jobs:
121121
(github.event_name == 'release' && startsWith(github.ref, 'refs/tags/tools/buildmgr/')) ||
122122
((github.event.schedule != '') && (!github.event.repository.private))
123123
runs-on: ubuntu-22.04
124-
timeout-minutes: 15
124+
timeout-minutes: 25
125125
permissions:
126126
contents: write
127127
steps:
@@ -222,7 +222,7 @@ jobs:
222222
needs: [ setup, build, docs ]
223223
# Debian package generation in ubuntu 22.04 produces incompatible metadata
224224
runs-on: ubuntu-22.04
225-
timeout-minutes: 15
225+
timeout-minutes: 25
226226
permissions:
227227
contents: write
228228
steps:
@@ -344,7 +344,7 @@ jobs:
344344

345345
test:
346346
needs: [ setup, matrix_prep, create_installer ]
347-
timeout-minutes: 15
347+
timeout-minutes: 25
348348
runs-on: ${{ matrix.runs_on }}
349349
name: test (${{ matrix.runs_on }}, ${{ matrix.arch }})
350350
env:
@@ -512,7 +512,7 @@ jobs:
512512
GCC_TOOLCHAIN_10_3_1: ${{ github.workspace }}/${{ matrix.toolchain_root }}
513513
AC6_TOOLCHAIN_6_18_0: ${{ github.workspace }}/${{ matrix.toolchain_root }}
514514
runs-on: ubuntu-22.04
515-
timeout-minutes: 15
515+
timeout-minutes: 25
516516

517517
steps:
518518
- name: Harden Runner
@@ -630,7 +630,7 @@ jobs:
630630

631631
sanity-check-native:
632632
needs: [ matrix_prep, create_installer ]
633-
timeout-minutes: 15
633+
timeout-minutes: 25
634634
runs-on: ${{ matrix.runs_on }}
635635
name: sanity check native (${{ matrix.runs_on }}, ${{ matrix.arch }})
636636
env:
@@ -674,7 +674,7 @@ jobs:
674674
675675
sanity-check-docker:
676676
needs: create_installer
677-
timeout-minutes: 15
677+
timeout-minutes: 25
678678
runs-on: ubuntu-22.04
679679
container:
680680
image: ${{ matrix.image }}
@@ -720,6 +720,7 @@ jobs:
720720
721721
test-results-preparation:
722722
name: "Publish Tests Results"
723+
if: ${{ always() }}
723724
needs: [ test ]
724725
runs-on: ubuntu-22.04
725726
steps:

.github/workflows/nightly.yml

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,51 @@ on:
88
permissions:
99
contents: write
1010

11+
concurrency:
12+
group: nightly-${{ github.ref }}-${{ github.event_name }}
13+
cancel-in-progress: false
14+
1115
jobs:
1216
buildmgr:
1317
if: github.repository == 'Open-CMSIS-Pack/devtools'
1418
uses: ./.github/workflows/buildmgr.yml
1519
secrets: inherit
20+
1621
packchk:
22+
if: always()
1723
needs: [buildmgr]
1824
uses: ./.github/workflows/packchk.yml
1925
secrets: inherit
26+
2027
packgen:
28+
if: always()
2129
needs: [packchk]
2230
uses: ./.github/workflows/packgen.yml
2331
secrets: inherit
32+
2433
projmgr:
34+
if: always()
2535
needs: [packgen]
2636
uses: ./.github/workflows/projmgr.yml
2737
secrets: inherit
38+
2839
svdconv:
40+
if: always()
2941
needs: [projmgr]
3042
uses: ./.github/workflows/svdconv.yml
3143
secrets: inherit
44+
3245
test_libs:
46+
if: always()
3347
needs: [svdconv]
3448
uses: ./.github/workflows/test_libs.yml
49+
secrets: inherit
50+
3551
coverage:
52+
if: always()
3653
runs-on: ubuntu-22.04
3754
needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ]
55+
3856
steps:
3957
- name: Harden Runner
4058
if: ${{ !github.event.repository.private }}
@@ -45,8 +63,7 @@ jobs:
4563
- name: Install dependencies
4664
run: |
4765
sudo apt-get update
48-
sudo apt-get install \
49-
lcov
66+
sudo apt-get install -y --no-install-recommends lcov
5067
5168
- name: Download coverage report
5269
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
@@ -57,7 +74,13 @@ jobs:
5774

5875
- name: Consolidate coverage data
5976
run: |
60-
lcov --rc lcov_branch_coverage=1 --add-tracefile coverage_packchk.info -a coverage_packgen.info -a coverage_projmgr.info -a coverage_buildmgr.info -a coverage_svdconv.info -o merged_coverage.info
77+
lcov --rc lcov_branch_coverage=1 \
78+
--add-tracefile coverage_packchk.info \
79+
-a coverage_packgen.info \
80+
-a coverage_projmgr.info \
81+
-a coverage_buildmgr.info \
82+
-a coverage_svdconv.info \
83+
-o merged_coverage.info
6184
working-directory: coverage/
6285

6386
- name: Archive merged coverage report
@@ -66,3 +89,38 @@ jobs:
6689
name: merged-coverage-report
6790
path: ./coverage/merged_coverage.info
6891
if-no-files-found: error
92+
93+
publish-test-results:
94+
if: github.repository == 'Open-CMSIS-Pack/devtools'
95+
name: Publish Test Results
96+
runs-on: ubuntu-22.04
97+
needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ]
98+
permissions:
99+
checks: write
100+
pull-requests: write
101+
steps:
102+
- name: Harden Runner
103+
if: ${{ !github.event.repository.private }}
104+
uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0
105+
with:
106+
egress-policy: audit
107+
108+
- name: Download and Extract Artifacts
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
run: |
112+
mkdir -p artifacts && cd artifacts
113+
114+
artifacts_url="https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts"
115+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while IFS=$'\t' read -r name url; do
116+
gh api "$url" > "${name}.zip"
117+
unzip -q -o -d "${name}" "${name}.zip"
118+
rm "${name}.zip"
119+
done
120+
121+
- name: Publish Test Results
122+
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0
123+
with:
124+
commit: ${{ github.sha }}
125+
report_individual_runs: true
126+
files: "artifacts/**/*.xml"

.github/workflows/packchk.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ on:
3737
types: [published]
3838

3939
concurrency:
40-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
40+
group: packchk-${{ github.ref }}-${{ github.event_name }}
4141
cancel-in-progress: true
4242

4343
permissions:
@@ -62,7 +62,7 @@ jobs:
6262
needs: [ setup, matrix_prep ]
6363
runs-on: ${{ matrix.runs_on }}
6464
name: build (${{ matrix.runs_on }}, ${{ matrix.arch }})
65-
timeout-minutes: 15
65+
timeout-minutes: 25
6666
strategy:
6767
fail-fast: true
6868
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -153,7 +153,7 @@ jobs:
153153
needs: [ setup, matrix_prep ]
154154
runs-on: ${{ matrix.runs_on }}
155155
name: test (${{ matrix.runs_on }}, ${{ matrix.arch }})
156-
timeout-minutes: 15
156+
timeout-minutes: 25
157157
strategy:
158158
fail-fast: false
159159
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -226,7 +226,7 @@ jobs:
226226
lcov_base: https://github.com/linux-test-project/lcov/releases/download/v1.15/
227227
lcov_installer: lcov-1.15.tar.gz
228228
runs-on: ubuntu-22.04
229-
timeout-minutes: 15
229+
timeout-minutes: 25
230230
steps:
231231
- name: Harden Runner
232232
if: ${{ !github.event.repository.private }}
@@ -337,7 +337,7 @@ jobs:
337337
startsWith(github.ref, 'refs/tags/tools/packchk/')
338338
needs: [ build, test, coverage ]
339339
runs-on: ubuntu-22.04
340-
timeout-minutes: 15
340+
timeout-minutes: 25
341341
permissions:
342342
contents: write
343343
steps:
@@ -369,6 +369,7 @@ jobs:
369369

370370
test-results-preparation:
371371
name: "Publish Tests Results"
372+
if: ${{ always() }}
372373
needs: [ test ]
373374
runs-on: ubuntu-22.04
374375
steps:

.github/workflows/packgen.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ on:
3232
types: [published]
3333

3434
concurrency:
35-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
35+
group: packgen-${{ github.ref }}-${{ github.event_name }}
3636
cancel-in-progress: true
3737

3838
permissions:
@@ -57,7 +57,7 @@ jobs:
5757
needs: [ setup, matrix_prep ]
5858
runs-on: ${{ matrix.runs_on }}
5959
name: build (${{ matrix.runs_on }}, ${{ matrix.arch }})
60-
timeout-minutes: 15
60+
timeout-minutes: 25
6161
strategy:
6262
fail-fast: true
6363
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -119,7 +119,7 @@ jobs:
119119
startsWith(github.ref, 'refs/tags/tools/packgen/')
120120
needs: [ build, unittest ]
121121
runs-on: ubuntu-22.04
122-
timeout-minutes: 15
122+
timeout-minutes: 25
123123
permissions:
124124
contents: write
125125
steps:
@@ -187,7 +187,7 @@ jobs:
187187
needs: [ setup, matrix_prep ]
188188
name: unittest (${{ matrix.runs_on }}, ${{ matrix.arch }})
189189
runs-on: ${{ matrix.runs_on }}
190-
timeout-minutes: 15
190+
timeout-minutes: 25
191191
strategy:
192192
fail-fast: true
193193
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -237,7 +237,7 @@ jobs:
237237
lcov_base: https://github.com/linux-test-project/lcov/releases/download/v1.15/
238238
lcov_installer: lcov-1.15.tar.gz
239239
runs-on: ubuntu-22.04
240-
timeout-minutes: 15
240+
timeout-minutes: 25
241241
steps:
242242
- name: Harden Runner
243243
if: ${{ !github.event.repository.private }}
@@ -326,6 +326,7 @@ jobs:
326326

327327
test-results-preparation:
328328
name: "Publish Tests Results"
329+
if: ${{ always() }}
329330
needs: [ unittest ]
330331
runs-on: ubuntu-22.04
331332
steps:

.github/workflows/projmgr.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ on:
3636
types: [published]
3737

3838
concurrency:
39-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
39+
group: projmgr-${{ github.ref }}-${{ github.event_name }}
4040
cancel-in-progress: true
4141

4242
permissions:
@@ -61,7 +61,7 @@ jobs:
6161
needs: [ setup, matrix_prep ]
6262
runs-on: ${{ matrix.runs_on }}
6363
name: build (${{ matrix.runs_on }},${{ matrix.arch }})
64-
timeout-minutes: 20
64+
timeout-minutes: 25
6565
strategy:
6666
# fail-fast: true
6767
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -139,7 +139,7 @@ jobs:
139139
needs: [ setup, matrix_prep ]
140140
name: build-swig (${{ matrix.runs_on }}, ${{ matrix.arch }})
141141
runs-on: ${{ matrix.runs_on }}
142-
timeout-minutes: 20
142+
timeout-minutes: 25
143143
strategy:
144144
# fail-fast: true
145145
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -208,7 +208,7 @@ jobs:
208208
startsWith(github.ref, 'refs/tags/tools/projmgr/')
209209
needs: [ build, build-swig, unittest, coverage ]
210210
runs-on: ubuntu-22.04
211-
timeout-minutes: 15
211+
timeout-minutes: 25
212212
permissions:
213213
contents: write
214214

@@ -369,7 +369,7 @@ jobs:
369369
needs: [ setup, matrix_prep ]
370370
name: unittest (${{ matrix.runs_on }}, ${{ matrix.arch }})
371371
runs-on: ${{ matrix.runs_on }}
372-
timeout-minutes: 15
372+
timeout-minutes: 25
373373
strategy:
374374
fail-fast: false
375375
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
@@ -429,7 +429,7 @@ jobs:
429429
lcov_base: https://github.com/linux-test-project/lcov/releases/download/v1.15/
430430
lcov_installer: lcov-1.15.tar.gz
431431
runs-on: ubuntu-22.04
432-
timeout-minutes: 15
432+
timeout-minutes: 25
433433
steps:
434434
- name: Harden Runner
435435
if: ${{ !github.event.repository.private }}
@@ -518,6 +518,7 @@ jobs:
518518

519519
test-results-preparation:
520520
name: "Publish Tests Results"
521+
if: ${{ always() }}
521522
needs: [ unittest ]
522523
runs-on: ubuntu-22.04
523524
steps:

0 commit comments

Comments
 (0)