-
Notifications
You must be signed in to change notification settings - Fork 15
166 lines (135 loc) · 4.97 KB
/
cmsis_rv2.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: RTOS2 Validation
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CMSIS_PACK_ROOT: ${{ github.workspace }}/.packs
ARM_UBL_ACTIVATION_CODE: ${{ secrets.ARM_UBL_ACTIVATION_CODE }}
jobs:
build-and-run:
strategy:
fail-fast: true
matrix:
compiler: [AC6, GCC, Clang]
rtos: [RTX5, FreeRTOS]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: CMSIS-RTOS2_Validation
- uses: actions/checkout@v4
with:
repository: ARM-software/CMSIS_6
path: CMSIS_6
- uses: actions/checkout@v4
with:
repository: ARM-software/CMSIS-RTX
path: CMSIS-RTX
- uses: actions/checkout@v4
with:
repository: ARM-software/Cortex_DFP
path: Cortex_DFP
- uses: actions/checkout@v4
with:
repository: ARM-software/CMSIS-FreeRTOS
path: CMSIS-FreeRTOS
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install system packages
run: |
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install libpython3.9 libtinfo5
- name: Python requirements
run: |
pip install -r ./CMSIS-RTOS2_Validation/Project/requirements.txt
- name: Cache packs
uses: actions/cache@v4
with:
key: packs-${{ github.run_id }}-${{ matrix.compiler }}-${{ matrix.rtos }}
restore-keys: |
packs-
path: ${{env.CMSIS_PACK_ROOT}}
- name: Setup vcpkg environment
uses: ARM-software/cmsis-actions/vcpkg@main
with:
config: ./CMSIS-RTOS2_Validation/Project/vcpkg-configuration.json
cache: "-${{ matrix.compiler }}-${{ matrix.rtos }}"
- name: Activate Arm tool license
run: |
if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then
armlm activate --code ${{ env.ARM_UBL_ACTIVATION_CODE }}
else
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
fi
- name: Register local packs
run: |
cpackget init https://www.keil.com/pack/index.pidx
cpackget rm ARM::CMSIS ARM::Cortex_DFP ARM::CMSIS-RTX ARM::CMSIS-FreeRTOS || echo "Ok"
cpackget add ./CMSIS_6/ARM.CMSIS.pdsc
cpackget add ./CMSIS-RTX/ARM.CMSIS-RTX.pdsc
cpackget add ./CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc
cpackget add ./Cortex_DFP/ARM.Cortex_DFP.pdsc
- uses: ammaraskar/gcc-problem-matcher@master
if: matrix.compiler == 'GCC'
- name: Initialize CodeQL
if: matrix.compiler == 'GCC'
uses: github/codeql-action/init@v3
with:
languages: c-cpp
queries: security-and-quality
- name: Build
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
echo "Build test projects ..."
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ==="
- name: Execute
if: env.ARM_UBL_ACTIVATION_CODE
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
echo "Run test projects ..."
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} run || echo "::warning::==== Some configurations failed to run! ==="
- name: Deactivate Arm tool license
if: always()
run: |
if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then
armlm deactivate --code ${{ env.ARM_UBL_ACTIVATION_CODE }}
else
armlm deactivate --product KEMDK-COM0
fi
- name: Perform CodeQL Analysis
if: matrix.compiler == 'GCC'
uses: github/codeql-action/analyze@v3
- name: Upload Test Reports
if: ${{ !cancelled() && env.ARM_UBL_ACTIVATION_CODE }}
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.rtos }}-${{ matrix.compiler }}
path: ./CMSIS-RTOS2_Validation/Project/*.junit
publish-test-results:
needs: [build-and-run]
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Download Test Reports
if: ${{ env.ARM_UBL_ACTIVATION_CODE }}
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Test Results
if: ${{ env.ARM_UBL_ACTIVATION_CODE && env.GITHUB_TOKEN }}
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: ${{ github.event_path }}
report_individual_runs: true
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.junit"