-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (101 loc) · 3.29 KB
/
build_test_firmware.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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/[email protected]
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