Run codeql anaysis on all platforms #885
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2022 Paul Guyot <[email protected]> | |
# | |
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
# | |
name: STM32 Build | |
on: | |
push: | |
paths: | |
- '.github/workflows/stm32-build.yaml' | |
- 'CMakeLists.txt' | |
- 'src/platforms/stm32/**' | |
- 'src/libAtomVM/**' | |
pull_request: | |
paths: | |
- '.github/workflows/stm32-build.yaml' | |
- 'CMakeLists.txt' | |
- 'src/platforms/stm32/**' | |
- 'src/libAtomVM/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
stm32: | |
runs-on: ubuntu-24.04 | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- uses: actions/cache@v4 | |
id: builddeps-cache | |
with: | |
path: | | |
/home/runner/libopencm3 | |
key: ${{ runner.os }}-build-deps | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "27" | |
hexpm-mirrors: | | |
https://builds.hex.pm | |
https://repo.hex.pm | |
https://cdn.jsdelivr.net/hex | |
- name: "apt update" | |
run: sudo apt update | |
- name: "Install deps" | |
run: sudo apt install -y cmake gperf gcc-arm-none-eabi | |
- name: Checkout and build libopencm3 | |
if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }} | |
working-directory: /home/runner | |
run: | | |
set -euo pipefail | |
cd /home/runner | |
test -d libopencm3 && rm -fr libopencm3 | |
git clone https://github.com/libopencm3/libopencm3.git -b v0.8.0 | |
cd libopencm3 | |
make | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: "Git config safe.directory for codeql" | |
run: git config --global --add safe.directory /__w/AtomVM/AtomVM | |
- name: "Initialize CodeQL" | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: 'cpp' | |
build-mode: manual | |
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql | |
- name: Build | |
shell: bash | |
working-directory: ./src/platforms/stm32/ | |
run: | | |
set -euo pipefail | |
mkdir build | |
cd build | |
# -DAVM_WARNINGS_ARE_ERRORS=ON | |
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DLIBOPENCM3_DIR=/home/runner/libopencm3 | |
make -j | |
- name: "Perform CodeQL Analysis" | |
uses: github/codeql-action/analyze@v3 |