-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 1.99 KB
/
build.yml
File metadata and controls
79 lines (69 loc) · 1.99 KB
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
name: Build Project
on:
workflow_call:
inputs:
preset:
description: >
CMake preset to build the project, run
`cmake --build --list-presets` to see options
required: false
type: string
default: 'nucleo-debug'
outputs:
build-artifact:
description: 'Build result artifact id for later use'
value: ${{ jobs.build.outputs.build-artifact }}
workflow_dispatch:
inputs:
preset:
description: >
CMake preset to build the project, run
`cmake --build --list-presets` to see options
required: false
type: string
default: 'nucleo-debug'
jobs:
build:
name: Build Project
runs-on: ubuntu-24.04
permissions:
contents: read
packages: read
container:
image: ghcr.io/hyperloopupv-h8/hyperloop-firmware-toolchain:latest
outputs:
build-artifact: ${{ steps.upload-build-artifact.outputs.artifact-id }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: Init submodules
run: |
git config --global --add safe.directory '*'
git submodule update --init --depth 1
./deps/ST-LIB/tools/init-submodules.sh
shell: bash
- name: Setup Python environment
run: |
python3 -m venv virtual
source virtual/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
shell: bash
- name: Build
run: |
source virtual/bin/activate
cmake --preset ${{ inputs.preset }}
cmake --build --preset ${{ inputs.preset }}
shell: bash
- name: Upload Build
id: upload-build-artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.preset }}
path: out/build/latest.elf
retention-days: 7
compression-level: 0
if-no-files-found: error