-
Notifications
You must be signed in to change notification settings - Fork 1.1k
92 lines (78 loc) · 2.46 KB
/
codeql-analysis.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
name: "CodeQL"
on:
workflow_dispatch:
push:
branches: [ develop ]
paths:
- 'CMSIS/Core/**'
- 'CMSIS/Core_A/**'
- 'CMSIS/CoreValidation/**'
- 'Device/ARM/**'
pull_request:
branches: [ develop ]
paths:
- '.github/workflows/codeql-analysis.yml'
- 'CMSIS/Core/**'
- 'CMSIS/Core_A/**'
- 'CMSIS/CoreValidation/**'
- 'Device/ARM/**'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
env:
CMSIS_PACK_ROOT: /tmp/.packs-${{ github.run_id }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo apt install gcc-arm-none-eabi ninja-build cmake
- name: Cache pack folder
id: cache-packs
uses: actions/cache@v3
with:
key: packs-${{ github.run_id }}
restore-keys: |
packs-
path: /tmp/.packs-${{ github.run_id }}
- name: Install CMSIS-Toolbox
run: |
wget https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases/download/1.5.0/cmsis-toolbox.sh
chmod +x cmsis-toolbox.sh
sudo ./cmsis-toolbox.sh <<EOI
/opt/ctools
$CMSIS_PACK_ROOT
$(dirname $(which arm-none-eabi-gcc 2>/dev/null))
EOI
echo "/opt/ctools/bin" >> $GITHUB_PATH
echo "cpackget : $(which cpackget)"
echo "csolution: $(which csolution)"
echo "cbuild : $(which cbuild)"
- name: Initialize packs folder
if: steps.cache-packs.outputs.cache-hit != 'true'
run: cpackget init https://www.keil.com/pack/index.pidx
- name: Update pack index
if: steps.cache-packs.outputs.cache-hit == 'true'
run: cpackget update-index
- name: Install build.py requirements
run: pip install -r requirements.txt
working-directory: CMSIS/CoreValidation/Project
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality
- name: Build projects
working-directory: CMSIS/CoreValidation/Project
run: |
pip install -r requirements.txt
cpackget add -a -f cpacklist.txt
python build.py --verbose -c GCC -d "CM[047]*" -d "CM[23]3*" -o low build || echo "Something failed!"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2