Skip to content

Merge pull request #444 from 4ms/sort-lists-cleanup #529

Merge pull request #444 from 4ms/sort-lists-cleanup

Merge pull request #444 from 4ms/sort-lists-cleanup #529

name: Build and test firmware
on:
workflow_dispatch:
inputs:
linux_x64:
description: 'Build on Linux x64'
required: true
default: true
type: boolean
win_x64:
description: 'build on Windows x64'
required: true
default: false
type: boolean
skip_wifi:
description: 'Skip building wifi features'
default: false
type: boolean
push:
branches:
- main
- fix-ci
tags:
- 'firmware-v[0-9]+.[0-9]+.[0-9]+*'
paths:
- 'firmware/**'
- '!firmware/bootloader/**'
- '!**.md' # Skip docs
- '!shared/svgextract' # Skip generator script (still run CI if generated files change)
- '!shared/gen_minblep' # Skip generator script (still run CI if generated files change)
- '!shared/tableGen' # Skip generator script (still run CI if generated files change)
jobs:
build-lin:
if: ${{ github.event_name == 'push' || inputs.linux_x64 }}
strategy:
matrix:
gcc: ['12.3.Rel1'] # can add other versions if needed
name: "Build firmware"
runs-on: ubuntu-24.04
env:
preset: ${{ inputs.skip_wifi && 'base' || 'full' }}
steps:
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.gcc }}
- name: Install cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.26.x'
- name: Git setup
run: git config --global --add safe.directory '*'
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.CHECKOUT_TOKEN }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install ninja-build
- name: Build and test
run: cd firmware && cmake --fresh --preset ${{ env.preset }} -G Ninja && make all
- name: Set Release Version
if: startsWith(github.ref, 'refs/tags/firmware-v')
uses: FranzDiebold/github-env-vars-action@v2
- name: Release
if: startsWith(github.ref, 'refs/tags/firmware-v')
uses: softprops/action-gh-release@v1
with:
name: "Firmware Version: ${{ env.CI_REF_NAME }}"
files: |
firmware/build/metamodule*.zip
build-win:
if: ${{ inputs.win_x64 }}
name: "Build firmware on windows"
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
preset: ${{ inputs.skip_wifi && 'base' || 'full' }}
steps:
- name: Install windows dependencies
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
path-type: inherit
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.3.Rel1'
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.CHECKOUT_TOKEN }}
- name: Build and test
run: cd firmware && cmake --fresh --preset ${{ env.preset }} -G "Unix Makefiles" && make all