Skip to content

Commit 60642fa

Browse files
committed
Merge branch 'develop' into feature/improve-led-managers
2 parents 1b50c6a + 8f6e59a commit 60642fa

75 files changed

Lines changed: 2996 additions & 896 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build-compilationdb
2+
description: Builds the compilation database for the firmware for code analysis
3+
inputs:
4+
version:
5+
required: true
6+
description: 'Current firmware version'
7+
skip-checkout:
8+
description: 'If true, skips checkout'
9+
required: false
10+
default: false
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- uses: actions/checkout@v4
16+
if: ${{ !inputs.skip-checkout }}
17+
18+
- uses: actions/cache@v4
19+
with:
20+
path: |
21+
~/.platformio/platforms
22+
~/.platformio/packages
23+
~/.platformio/.cache
24+
key: pio-${{ runner.os }}-${{ hashFiles('platformio.ini', 'requirements.txt') }}
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
cache: 'pip'
29+
30+
- name: Install python dependencies
31+
shell: bash
32+
run: pip install -r requirements.txt
33+
34+
- name: Build firmware
35+
working-directory: .
36+
shell: bash
37+
run: pio run -e ci-build -t compiledb
38+
env:
39+
OPENSHOCK_FW_VERSION: ${{ inputs.version }}
40+
OPENSHOCK_FW_GIT_REF: ${{ github.ref }}
41+
OPENSHOCK_FW_GIT_COMMIT: ${{ github.sha }}
42+
OPENSHOCK_FW_BUILD_DATE: ${{ github.event.head_commit.timestamp }}

.github/scripts/get-vars.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ if (versionChangeLog !== '') {
201201
// Parse platformio.ini and extract the different boards
202202
const platformioIni = ini.parse(platformioIniStr);
203203

204-
// Get every key that starts with "env:", and that isnt "env:fs" (which is the filesystem)
204+
// Get every key that starts with "env:", and that isnt "env:fs" (which is the filesystem) or "env:ci-build" (which is for CI CodeQL and cppcheck)
205205
const boards = Object.keys(platformioIni)
206-
.filter((key) => key.startsWith('env:') && key !== 'env:fs')
206+
.filter((key) => key.startsWith('env:') && key !== 'env:fs' && key !== 'env:ci-build')
207207
.reduce((arr, key) => {
208208
arr.push(key.substring(4));
209209
return arr;

.github/workflows/codeql.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ jobs:
7070
language: 'c-cpp'
7171
OPENSHOCK_FW_VERSION: ${{ needs.get-vars.outputs.version }}
7272

73-
strategy:
74-
fail-fast: false
75-
matrix:
76-
board: ${{ fromJson(needs.get-vars.outputs.board-array) }}
77-
7873
steps:
7974
- name: Checkout repository
8075
uses: actions/checkout@v4
@@ -86,7 +81,7 @@ jobs:
8681

8782
- uses: ./.github/actions/build-firmware
8883
with:
89-
board: ${{ matrix.board }}
84+
board: ci-build
9085
skip-checkout: true
9186

9287
- name: Perform CodeQL Analysis

.github/workflows/cpp-linter.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,27 @@ on:
99
workflow_dispatch: # Manually invoked by user.
1010

1111
jobs:
12+
get-vars:
13+
uses: ./.github/workflows/get-vars.yml
14+
1215
cpp-linter:
16+
name: C/C++ Linter
1317
runs-on: ubuntu-latest
18+
needs: get-vars
19+
1420
permissions:
15-
contents: read
21+
contents: write
1622
pull-requests: write
23+
1724
steps:
18-
- uses: actions/checkout@v4
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- uses: ./.github/actions/build-compilationdb
29+
with:
30+
board: OpenShock-Core-V2 # Doesn't matter, just need the compilation database
31+
skip-checkout: true
32+
1933
- uses: cpp-linter/cpp-linter-action@v2
2034
id: linter
2135
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ data/www
1717
.vs
1818
packages
1919
*.sln
20+
compile_commands.json

frontend/package-lock.json

Lines changed: 93 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)