-
Notifications
You must be signed in to change notification settings - Fork 66
137 lines (118 loc) · 4.4 KB
/
Copy pathnightly.yml
File metadata and controls
137 lines (118 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: nightly
on:
workflow_dispatch:
inputs:
trigger_toolbox_build:
description: 'Trigger cmsis-toolbox build as a part of this workflow'
required: false
default: false
type: boolean
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
concurrency:
group: nightly-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: false
jobs:
buildmgr:
if: github.repository == 'Open-CMSIS-Pack/devtools'
uses: ./.github/workflows/buildmgr.yml
secrets: inherit
packchk:
if: github.repository == 'Open-CMSIS-Pack/devtools'
uses: ./.github/workflows/packchk.yml
secrets: inherit
packgen:
if: github.repository == 'Open-CMSIS-Pack/devtools'
uses: ./.github/workflows/packgen.yml
secrets: inherit
projmgr:
if: github.repository == 'Open-CMSIS-Pack/devtools'
uses: ./.github/workflows/projmgr.yml
secrets: inherit
svdconv:
if: github.repository == 'Open-CMSIS-Pack/devtools'
uses: ./.github/workflows/svdconv.yml
secrets: inherit
test_libs:
if: github.repository == 'Open-CMSIS-Pack/devtools'
uses: ./.github/workflows/test_libs.yml
secrets: inherit
coverage:
if: github.repository == 'Open-CMSIS-Pack/devtools'
runs-on: ubuntu-22.04
needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ]
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install lcov
- name: Download coverage report
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: coverage-report-*
path: coverage/
merge-multiple: true
- name: Consolidate coverage data
run: |
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
working-directory: coverage/
- name: Archive merged coverage report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: merged-coverage-report
path: ./coverage/merged_coverage.info
if-no-files-found: error
publish-test-results:
if: always() && github.repository == 'Open-CMSIS-Pack/devtools'
name: Publish Test Results
runs-on: ubuntu-22.04
needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ]
permissions:
checks: write
pull-requests: write
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Download and Extract Artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
with:
commit: ${{ github.sha }}
report_individual_runs: true
files: "artifacts/**/*.xml"
# Triggers the cmsis-toolbox nightly workflow in the separate repository
trigger-toolbox-nightly:
needs: [ publish-test-results, coverage ]
if: >-
success() &&
github.repository == 'Open-CMSIS-Pack/devtools' &&
(github.event_name == 'schedule' || github.event.inputs.trigger_toolbox_build)
runs-on: ubuntu-latest
steps:
- name: Trigger cmsis-toolbox Nightly
run: |
curl --fail-with-body --show-error --silent -X POST \
-H "Authorization: Bearer ${{ secrets.CROSS_REPO_TOOLBOX_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/Open-CMSIS-Pack/cmsis-toolbox/actions/workflows/nightly.yml/dispatches \
-d '{"ref":"main","inputs":{"trigger_extension_build":"true","use_nightly_devtools":"${{ github.event_name == 'schedule' && 'true' || 'false' }}"}}'