Skip to content

Commit

Permalink
chore(cmake): Add sensor variant firmware ci (#766)
Browse files Browse the repository at this point in the history
* add a configure and build preset for the special sensor firmware

* add a build task that builds just the applications, we don't need the images, and we don't need the release

* make the workflow task have a better name

* ignore the dist-sensor directory

* guess we gotta build the images for install to run

* use the other preset in the test gitub workflow
  • Loading branch information
ryanthecoder authored Apr 10, 2024
1 parent 40a5db1 commit ed0f77e
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 7 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build_sensor_fw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Build firmware sensor variant bundles"
on:
push:
branches:
- '*'
tags:
- 'v*'
workflow_dispatch:

env:
ci: 1

defaults:
run:
shell: bash

jobs:
build:
name: "Build"
runs-on: "ubuntu-latest"
timeout-minutes: 20
steps:
- uses: "actions/checkout@v2"
with:
fetch-depth: 0
- uses: "actions/cache@v3"
with:
path: "./stm32-tools"
key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }}
- name: 'CMake configure'
run: |
cmake --preset=cross-sensor-buffer . -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: 'Build images'
run: |
cmake --build --preset=firmware-g4-sensors --target firmware-applications firmware-images
- name: 'Prep images for upload'
run: |
cmake --install ./build-cross-sensor
- name: 'Upload application artifact'
uses: actions/upload-artifact@v3
with:
name: 'firmware-applications-${{github.ref_name}}'
path: |
dist-sensor/applications/*
14 changes: 7 additions & 7 deletions .github/workflows/cross-compile-special-sensors.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "cross-compile/format/lint all targets"
name: "cross-compile-sensors/format/lint all targets"
on:
push:
branches:
Expand Down Expand Up @@ -47,10 +47,10 @@ jobs:
cache-version: ${{ secrets.CACHE_VERSION }}

- name: Configure
run: cmake --preset=cross . -DUSE_PRESSURE_MOVE=true
run: cmake --preset=cross-sensor-buffer .

- name: Build all STM32G4 applications
run: cmake --build --preset=${{ matrix.target }} --target ${{ matrix.target }}-images ${{ matrix.target }}-applications
run: cmake --build ./build-cross-sensor --target ${{ matrix.target }}-images ${{ matrix.target }}-applications

format:
runs-on: "ubuntu-20.04"
Expand All @@ -76,10 +76,10 @@ jobs:
cache-version: ${{ secrets.CACHE_VERSION }}

- name: Configure
run: cmake --preset=cross . -DUSE_PRESSURE_MOVE=true
run: cmake --preset=cross-sensor-buffer .

- name: Format
run: cmake --build ./build-cross --target format-ci
run: cmake --build ./build-cross-sensor --target format-ci

lint:
runs-on: "ubuntu-20.04"
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
cache-version: ${{ secrets.CACHE_VERSION }}

- name: Configure
run: cmake --preset=cross . -DUSE_PRESSURE_MOVE=true
run: cmake --preset=cross-sensor-buffer .

- name: Format
run: cmake --build ./build-cross --target ${{ matrix.target }}-lint
run: cmake --build ./build-cross-sensor --target ${{ matrix.target }}-lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CMakeUserPresets.json
*.pyc
build-cross/
build-cross-pipettes/
build-cross-sensor/
stm32-tools/
build-host/
cmake-build-debug/
Expand All @@ -17,3 +18,4 @@ state_manager/coverage.xml
state_manager/dist/
state_manager/poetry.toml
dist/
dist-sensor/
22 changes: 22 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
"binaryDir": "${sourceDir}/build-cross",
"inherits": "cross-no-directory-reqs"
},
{
"name": "cross-sensor-buffer",
"displayName": "STM32 G4 OT-3 cross-compilation with sensor data buffers",
"description": "Build application firmware for OT-3 systems that use STM32, for flashing onto boards",
"installDir": "${sourceDir}/dist-sensor",
"binaryDir": "${sourceDir}/build-cross-sensor",
"cacheVariables": {
"USE_PRESSURE_MOVE": true
},
"inherits": "cross"
},
{
"name": "host",
"displayName": "STM32 OT-3 host compilation for tests",
Expand Down Expand Up @@ -88,6 +99,17 @@
"firmware-images"
]
},
{
"name": "firmware-g4-sensors",
"displayName": "All G4 Firmwares With Sensor Data Buffers",
"description": "Environment to build all g4 firmware - see firmware-l5",
"configurePreset": "cross-sensor-buffer",
"jobs": 4,
"targets": [
"firmware-applications",
"firmware-images"
]
},
{
"name": "pipettes",
"displayName": "pipettes binaries",
Expand Down

0 comments on commit ed0f77e

Please sign in to comment.