-
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (98 loc) · 3.04 KB
/
codeql.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
name: "CodeQL with CMake Build"
on:
push:
branches: [ "main", "default-branch-rule" ]
paths-ignore:
- 'lib/**'
pull_request:
branches: [ "main", "default-branch-rule" ]
paths-ignore:
- 'lib/**'
schedule:
- cron: '35 20 * * 0'
env:
BUILD_TYPE: Release
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- if: matrix.build-mode == 'manual'
name: Setup Environment
run: |
echo "Setting up the environment"
sudo apt-get update
sudo apt-get install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential
- if: matrix.build-mode == 'manual'
name: Setup PICO SDK
run: |
echo "Setting up PICO SDK"
cd lib/pico-sdk
git submodule update --init
echo "PICO_SDK_PATH=$(pwd)" >> $GITHUB_ENV
# - if: matrix.build-mode == 'manual'
# name: Setup PICO Examples
# run: |
# echo "Setting up PICO Examples"
# cd lib/pico-examples
# git submodule update --init
# echo "PICO_EXAMPLES_PATH=$(pwd)" >> $GITHUB_ENV
- if: matrix.build-mode == 'manual'
name: Setup PICO Extras
run: |
echo "Setting up PICO Extras"
cd lib/pico-extras
git submodule update --init
echo "PICO_EXTRAS_PATH=$(pwd)" >> $GITHUB_ENV
# - if: matrix.build-mode == 'manual'
# name: Setup FreeRTOS Kernel
# run: |
# echo "Setting up FreeRTOS Kernel"
# cd lib/FreeRTOS-Kernel
# git submodule update --init
# echo "FREERTOS_KERNEL_PATH=$(pwd)" >> $GITHUB_ENV
- if: matrix.build-mode == 'manual'
name: Setup Pico Board
run: |
echo "Setting up Pico Board"
echo "PICO_BOARD=pico_w" >> $GITHUB_ENV
- if: matrix.build-mode == 'manual'
name: Create wifi_credentials.h
run: |
cat <<EOT >> ./include/wifi_credentials.h
#ifndef _WIFI_CREDENTIALS_H
#define _WIFI_CREDENTIALS_H
#define WIFI_SSID "wifi_ssid"
#define WIFI_PASSWORD "wifi_password"
#endif
EOT
- if: matrix.build-mode == 'manual'
name: Build Main Project
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
make -j$(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"