Skip to content

Commit a468d6e

Browse files
jorgesg82Copilot
andauthored
Refactored compile infrastructure (#531)
* modified compile flow * Added build image * fixed minor syntax error on yml * Improved submodule init * Marked repos as safe * Removed source virtual env python * fixed artifact path * Removed simulator build on CI * Moved image to organization * Fixed modules initialization script path * Fixed modules initialization script path * removed some comments * minor fix * Replace commented-out StateOrder code with #ifdef STLIB_ETH guards (#532) * Initial plan * Replace commented-out StateOrder code with #ifdef STLIB_ETH preprocessor guards Co-authored-by: jorgesg82 <125664643+jorgesg82@users.noreply.github.com> * Address feedback on commented-out StateOrder code Co-authored-by: jorgesg82 <125664643+jorgesg82@users.noreply.github.com> * Remove CodeQL build artifacts and update .gitignore Co-authored-by: jorgesg82 <125664643+jorgesg82@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jorgesg82 <125664643+jorgesg82@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 78adfa0 commit a468d6e

59 files changed

Lines changed: 895 additions & 4173 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Toolchain Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ refactor/cmake ]
7+
paths:
8+
- 'ci/Dockerfile'
9+
- '.github/workflows/build-toolchain-image.yml'
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-24.04
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Log in to GHCR
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: .
33+
file: ci/Dockerfile
34+
push: true
35+
tags: ghcr.io/hyperloopupv-h8/hyperloop-firmware-toolchain:latest

.github/workflows/build.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,63 @@ on:
44
workflow_call:
55
inputs:
66
preset:
7-
description: |
8-
'CMake preset to build the project, run `cmake --build --list-presets' to see a complete list of options'
9-
required: true
7+
description: >
8+
CMake preset to build the project, run
9+
`cmake --build --list-presets` to see options
10+
required: false
1011
type: string
1112
default: 'nucleo-debug'
1213
outputs:
1314
build-artifact:
1415
description: 'Build result artifact id for later use'
1516
value: ${{ jobs.build.outputs.build-artifact }}
17+
1618
workflow_dispatch:
1719
inputs:
1820
preset:
19-
description: |
20-
'CMake preset to build the project, run `cmake --build --list-presets' to see a complete list of options'
21-
required: true
21+
description: >
22+
CMake preset to build the project, run
23+
`cmake --build --list-presets` to see options
24+
required: false
2225
type: string
2326
default: 'nucleo-debug'
2427

2528
jobs:
2629
build:
2730
name: Build Project
2831
runs-on: ubuntu-24.04
32+
33+
container:
34+
image: ghcr.io/hyperloopupv-h8/hyperloop-firmware-toolchain:latest
35+
2936
outputs:
3037
build-artifact: ${{ steps.upload-build-artifact.outputs.artifact-id }}
31-
container:
32-
image: jmaralo/hyperloop-upv-firmware:0.3.0
38+
3339
steps:
34-
- name: Clone Project
35-
uses: actions/checkout@v3
40+
- name: Checkout
41+
uses: actions/checkout@v4
3642
with:
37-
submodules: recursive
43+
submodules: false
44+
fetch-depth: 1
45+
46+
- name: Init submodules\
47+
run: |
48+
git config --global --add safe.directory '*'
49+
./tools/init-submodules.sh
50+
shell: bash
51+
3852
- name: Build
3953
run: |
40-
cmake --preset ${{ inputs.preset }} .
54+
cmake --preset ${{ inputs.preset }}
4155
cmake --build --preset ${{ inputs.preset }}
56+
shell: bash
57+
4258
- name: Upload Build
4359
id: upload-build-artifact
4460
uses: actions/upload-artifact@v4
4561
with:
4662
name: ${{ inputs.preset }}
47-
path: out/build/test.elf
63+
path: out/build/${{ inputs.preset }}/libst-lib.a
4864
retention-days: 7
4965
compression-level: 0
50-
if-no-files-found: ignore
51-
66+
if-no-files-found: error

.github/workflows/compile-checks.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ on:
99
- '**.c'
1010
- '**.h'
1111
- '**.py'
12+
- 'CMakeLists.txt'
1213
branches:
1314
- development
1415

16+
workflow_run:
17+
workflows: [ "Build Toolchain Image" ]
18+
types:
19+
- completed
20+
1521
jobs:
1622
compile-checks:
1723
name: Check project compiles
@@ -30,7 +36,7 @@ jobs:
3036
- board-debug-eth
3137
- board-release-eth
3238
- board-relwithdebinfo-eth
33-
- simulator
39+
# - simulator
3440
fail-fast: false
3541
uses: ./.github/workflows/build.yml
3642
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,5 @@ CMakeUserPresets.json
8989
*.su
9090
*.idb
9191
*.pdb
92+
_codeql_build_dir/
93+
_codeql_detected_source_root

0 commit comments

Comments
 (0)