Skip to content

Commit dd0aff2

Browse files
committed
Run codeql anaysis on all platforms
Add codeql to esp32-build.yaml workflow Add codeql to pico-build.yaml workflow Add codeql to stm32-build.yaml workflow Add codeql to wasm-build.yaml workflow Signed-off-by: Winford <[email protected]>
1 parent a7dbecd commit dd0aff2

File tree

5 files changed

+59
-1
lines changed

5 files changed

+59
-1
lines changed

.github/workflows/esp32-build.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737

3838
matrix:
3939
esp-idf-target: ["esp32", "esp32c3"]
40+
language: ['cpp']
4041
idf-version:
4142
- 'v5.0.7'
4243
- 'v5.1.5'
@@ -53,6 +54,13 @@ jobs:
5354
- name: Checkout repo
5455
uses: actions/checkout@v4
5556

57+
- name: "Initialize CodeQL"
58+
uses: github/codeql-action/init@v3
59+
with:
60+
languages: ${{matrix.language}}
61+
mode: manual
62+
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql
63+
5664
- name: Build with idf.py
5765
shell: bash
5866
working-directory: ./src/platforms/esp32/
@@ -69,6 +77,9 @@ jobs:
6977
. $IDF_PATH/export.sh
7078
idf.py size-components
7179
80+
- name: "Perform CodeQL Analysis"
81+
uses: github/codeql-action/analyze@v3
82+
7283
- name: Install dependencies to build host AtomVM and run qemu
7384
run: |
7485
set -eu

.github/workflows/pico-build.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
strategy:
3838
matrix:
3939
board: ["pico", "pico_w"]
40+
language: ["cpp"]
4041

4142
steps:
4243
- name: Checkout repo
@@ -48,6 +49,13 @@ jobs:
4849
- name: "Install deps"
4950
run: sudo apt install -y cmake gperf ninja-build gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib erlang-base erlang-dialyzer
5051

52+
- name: "Initialize CodeQL"
53+
uses: github/codeql-action/init@v3
54+
with:
55+
languages: ${{matrix.language}}
56+
mode: manual
57+
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql
58+
5159
- name: Build
5260
shell: bash
5361
working-directory: ./src/platforms/rp2040/
@@ -58,6 +66,9 @@ jobs:
5866
cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }}
5967
ninja
6068
69+
- name: "Perform CodeQL Analysis"
70+
uses: github/codeql-action/analyze@v3
71+
6172
- name: Install nvm and nodejs 20
6273
run: |
6374
set -euo pipefail

.github/workflows/stm32-build.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ jobs:
6363
- name: Checkout repo
6464
uses: actions/checkout@v4
6565

66+
- name: "Initialize CodeQL"
67+
uses: github/codeql-action/init@v3
68+
with:
69+
languages: 'cpp'
70+
mode: manual
71+
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql
72+
6673
- name: Build
6774
shell: bash
6875
working-directory: ./src/platforms/stm32/
@@ -73,3 +80,6 @@ jobs:
7380
# -DAVM_WARNINGS_ARE_ERRORS=ON
7481
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DLIBOPENCM3_DIR=/home/runner/libopencm3
7582
make -j
83+
84+
- name: "Perform CodeQL Analysis"
85+
uses: github/codeql-action/analyze@v3

.github/workflows/wasm-build.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,38 @@ concurrency:
3030
cancel-in-progress: true
3131

3232
jobs:
33-
compile_tests:
33+
compile_and_test:
34+
- name: "Compile, analyze, and test"
3435
runs-on: ubuntu-24.04
3536
container: erlang:27
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
language: ["cpp", "javascript"]
42+
include:
43+
- language: "cpp"
44+
query: "+./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql"
45+
- language: "javascript"
46+
query: ""
47+
3648
steps:
3749
- name: Checkout repo
3850
uses: actions/checkout@v4
3951

4052
- name: Install required packages
4153
run: apt update && apt install -y gperf zlib1g-dev cmake ninja-build
4254

55+
- name: "Git config safe.directory for codeql"
56+
run: git config --global --add safe.directory /__w/AtomVM/AtomVM
57+
58+
- name: "Initialize CodeQL"
59+
uses: github/codeql-action/init@v3
60+
with:
61+
languages: ${{matrix.language}}
62+
mode: manual
63+
queries: ${{matrix.query}}
64+
4365
- name: Compile AtomVM and test modules
4466
run: |
4567
set -e
@@ -49,6 +71,9 @@ jobs:
4971
# test_eavmlib does not work with wasm due to http + ssl test
5072
ninja AtomVM atomvmlib test_alisp hello_world run_script call_cast html5_events wasm_webserver
5173
74+
- name: "Perform CodeQL Analysis"
75+
uses: github/codeql-action/analyze@v3
76+
5277
- name: Upload AtomVM and test modules
5378
uses: actions/upload-artifact@v4
5479
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
- Added the ability to run beams from the CLI for Generic Unix platform (it was already possible with nodejs and emscripten).
1212
- Added preliminary support for ESP32P4 (no networking support yet).
13+
- CodeQL action runs on all platforms
1314

1415
### Fixed
1516

0 commit comments

Comments
 (0)