]> begriffs open source - cmsis-freertos/blob - .github/workflows/cmsis_rv2.yaml
Correct memory allocation and access in osMemoryPoolNew (#142)
[cmsis-freertos] / .github / workflows / cmsis_rv2.yaml
1
2 name: RTOS2 Validation
3
4 on:
5   workflow_dispatch:
6   pull_request:
7   push:
8     branches: [main]
9
10 concurrency:
11   group: ${{ github.workflow }}-${{ github.ref }}
12   cancel-in-progress: true
13
14 env:
15   CMSIS_PACK_ROOT: ${{ github.workspace }}/.packs
16   ARM_UBL_ACTIVATION_CODE: ${{ secrets.ARM_UBL_ACTIVATION_CODE }} 
17
18 jobs:
19   build-and-run:
20     strategy:
21       fail-fast: true
22       matrix:
23         compiler: [AC6, GCC, Clang]
24     
25     runs-on: ubuntu-24.04
26
27     steps:
28       - name: Checkout CMSIS-FreeRTOS
29         uses: actions/checkout@v4
30         with:
31           path: CMSIS-FreeRTOS
32           fetch-depth: 0
33       
34       - name: Checkout CMSIS_6
35         uses: actions/checkout@v4
36         with:
37           repository: ARM-software/CMSIS_6
38           path: CMSIS_6
39
40       - name: Checkout CMSIS-RTOS2_Validation
41         uses: actions/checkout@v4
42         with:
43           repository: ARM-software/CMSIS-RTOS2_Validation
44           path: CMSIS-RTOS2_Validation
45
46       - name: Checkout Cortex_DFP
47         uses: actions/checkout@v4
48         with:
49           repository: ARM-software/Cortex_DFP
50           path: Cortex_DFP
51   
52       - name: Setup Python 3.10
53         uses: actions/setup-python@v5
54         with:
55           python-version: '3.10'    
56
57       - name: Install system packages
58         run: |
59           sudo add-apt-repository ppa:deadsnakes/ppa
60           sudo apt-get install libpython3.9 libtinfo6
61
62       - name: Python requirements
63         run: |
64           pip install -r ./CMSIS-RTOS2_Validation/Project/requirements.txt
65
66       - name: Cache packs
67         uses: actions/cache@v4
68         with:
69           key: packs-${{ github.run_id }}-${{ matrix.compiler }}
70           restore-keys: |
71               packs-
72           path: /home/runner/.cache/arm/packs
73
74       - name: Setup vcpkg environment
75         uses: ARM-software/cmsis-actions/vcpkg@main
76         with:
77           config: ./CMSIS-RTOS2_Validation/Project/vcpkg-configuration.json
78           cache: "-${{ matrix.compiler }}"
79
80       - name: Activate Arm tool license
81         run: |
82           if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then
83             armlm activate --code ${{ env.ARM_UBL_ACTIVATION_CODE }}
84           else
85             armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
86           fi
87
88       - name: Register local packs
89         run: |
90           cpackget init https://www.keil.com/pack/index.pidx
91           cpackget rm ARM::CMSIS ARM::CMSIS-FreeRTOS ARM::Cortex_DFP || echo "Ok"
92
93           cpackget add ./CMSIS_6/ARM.CMSIS.pdsc
94           cpackget add ./CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc
95           cpackget add ./Cortex_DFP/ARM.Cortex_DFP.pdsc
96           cpackget add -an ARM.CMSIS-RTX
97
98       - uses: ammaraskar/gcc-problem-matcher@master
99         if: matrix.compiler == 'GCC'
100       
101       - name: Build
102         working-directory: ./CMSIS-RTOS2_Validation/Project
103         run: |
104           echo "Build test projects ..."
105           ./build.py --verbose -r FreeRTOS -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ==="
106
107       - name: Execute
108         working-directory: ./CMSIS-RTOS2_Validation/Project
109         run: |
110           echo "Run test projects ..."
111           ./build.py --verbose -r FreeRTOS -c ${{ matrix.compiler }} run || echo "::warning::==== Some configurations failed to run! ==="
112
113       - name: Deactivate Arm tool license
114         if: always()
115         working-directory: ./CMSIS-RTOS2_Validation/Project
116         run: |
117           if [[ -n "${{ env.ARM_UBL_ACTIVATION_CODE }}" ]]; then
118             armlm deactivate --code ${{ env.ARM_UBL_ACTIVATION_CODE }}
119           else
120             armlm deactivate --product KEMDK-COM0
121           fi
122     
123       - name: Upload Test Reports
124         if: ${{ !cancelled() }}
125         uses: actions/upload-artifact@v4
126         with:
127           name: test-results-${{ matrix.compiler }}
128           path: ./CMSIS-RTOS2_Validation/Project/*.junit
129
130
131   publish-test-results:
132     needs: [build-and-run]
133     runs-on: ubuntu-24.04
134     if: github.event_name == 'pull_request'
135
136     env:
137       GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138   
139     steps:
140       - name: Download Test Reports
141         uses: actions/download-artifact@v4
142         with:
143           path: artifacts
144
145       - name: Publish Test Results
146         if: ${{ env.GITHUB_TOKEN }}
147         uses: EnricoMi/publish-unit-test-result-action@v2
148         with:
149           commit: ${{ github.event.workflow_run.head_sha }}
150           event_file: ${{ github.event_path }}
151           report_individual_runs: true
152           event_name: ${{ github.event.workflow_run.event }}
153           files: "artifacts/**/*.junit"
154