]> begriffs open source - cmsis/blob - .github/workflows/corevalidation.yml
Add GitHub workflow for CoreValidation
[cmsis] / .github / workflows / corevalidation.yml
1 name: Build CoreValidation tests
2 on:
3   workflow_dispatch:
4   pull_request:
5     branches: [main]
6   push:
7     branches: [main]
8   
9 concurrency:
10   group: ${{ github.workflow }}-${{ github.ref }}
11   cancel-in-progress: true
12
13 jobs:
14   corevalidation:
15     name: Build
16     runs-on: ubuntu-latest
17     steps:
18       - uses: actions/checkout@v3
19
20       - working-directory: /home/runner
21         env:
22           GH_TOKEN: ${{ github.token }}
23         run: |
24           if [ -d CMSIS-DFP ]; then
25             cd CMSIS-DFP
26             git fetch origin main
27             git checkout -f origin/main
28           else
29             gh repo clone ARM-software/CMSIS-DFP
30           fi
31
32       - uses: actions/setup-python@v4
33         with:
34           python-version: '3.10'    
35           cache: 'pip'
36
37       - name: Cache vcpkg
38         uses: actions/cache@v3
39         with:
40           key: vcpkg
41           path: /home/runner/.vcpkg
42
43       - name: Cache Arm Compiler 6
44         uses: actions/cache@v3
45         with:
46           key: armcompiler-6.20.0
47           path: /home/runner/standalone-linux-x86_64-rel.tgz
48
49       - name: Install Arm Compiler 6
50         working-directory: /home/runner
51         run: |
52           test -f standalone-linux-x86_64-rel.tgz || \
53             wget https://artifacts.keil.arm.com/arm-compiler/6.20/21/standalone-linux-x86_64-rel.tgz
54           mkdir -p arm-compiler-6.20.0
55           tar xf standalone-linux-x86_64-rel.tgz -C arm-compiler-6.20.0
56           echo "AC6_TOOLCHAIN_6_20_0=$(pwd)/arm-compiler-6.20.0/bin" >> $GITHUB_ENV
57         
58       - name: Initialize CodeQL
59         uses: github/codeql-action/init@v2
60         with:
61           languages: cpp
62           queries: security-and-quality
63
64       - name: Execute build
65         working-directory: ./CMSIS/CoreValidation/Project
66         run: |
67           echo "Install Python requirements"
68           pip install -r requirements.txt
69
70           echo "Activate vcpkg environment"
71           . <(curl https://aka.ms/vcpkg-init.sh -L)
72           vcpkg activate
73
74           echo "Activate Arm tool license"
75           ${AC6_TOOLCHAIN_6_20_0}/armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0
76
77           echo "Register local CMSIS-DFP pack"
78           cpackget add /home/runner/CMSIS-DFP/ARM.CMSIS_DFP.pdsc
79
80           echo "Run build script"
81           ./build.py --verbose -m FVP -c GCC -c AC6 build || echo "=== Something failed! ==="
82
83       - name: Perform CodeQL Analysis
84         if: always()
85         uses: github/codeql-action/analyze@v2
86