Skip to content

Commit 3c03390

Browse files
authored
Merge pull request #7 from loopj/fix-builds
[WIP] Update GitHub actions builds
2 parents f421fd5 + 34418b2 commit 3c03390

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ env:
1818
GECKO_SDK_PATH: ${{ github.workspace }}/gecko_sdk
1919
SIMPLICITY_COMMANDER_PATH: ${{ github.workspace }}/commander
2020
SLC_CLI_PATH: ${{ github.workspace }}/slc_cli
21+
ARM_TOOLCHAIN_PATH: ${{ github.workspace }}/arm-toolchain
22+
GECKO_SDK_VERSION: v4.4.5
23+
ARM_GNU_TOOLCHAIN_VERSION: 12.2.rel1
2124

2225
jobs:
2326
build:
@@ -30,8 +33,9 @@ jobs:
3033
steps:
3134
- name: Install build dependencies
3235
run: |
36+
export DEBIAN_FRONTEND=noninteractive
3337
sudo apt-get update
34-
sudo apt-get install -y cmake ninja-build
38+
sudo apt-get -o Dpkg::Options::="--path-exclude=/usr/share/man/*" -o Dpkg::Options::="--path-exclude=/usr/share/doc/*" -o Dpkg::Options::="--path-exclude=/usr/share/locale*" install -y cmake ninja-build
3539
3640
- name: Set up Python
3741
uses: actions/setup-python@v5
@@ -47,21 +51,39 @@ jobs:
4751
distribution: "temurin"
4852
java-version: "17"
4953

50-
- name: Install GNU Arm Embedded Toolchain
54+
- name: Cache ARM GNU Toolchain
55+
id: cache-arm-toolchain
56+
uses: actions/cache@v4
57+
with:
58+
path: ${{ env.ARM_TOOLCHAIN_PATH }}
59+
key: arm-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}
60+
61+
- name: Install ARM GNU Toolchain
62+
if: steps.cache-arm-toolchain.outputs.cache-hit != 'true'
5163
run: |
52-
cd /tmp
53-
wget -nv https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
54-
tar -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
64+
mkdir -p ${{ env.ARM_TOOLCHAIN_PATH }}
65+
curl -L "https://developer.arm.com/-/media/Files/downloads/gnu/${{ env.ARM_GNU_TOOLCHAIN_VERSION }}/binrel/arm-gnu-toolchain-${{ env.ARM_GNU_TOOLCHAIN_VERSION }}-x86_64-arm-none-eabi.tar.xz" | tar -xJ -C "${{ env.ARM_TOOLCHAIN_PATH }}" --strip-components=1
66+
67+
- name: Add ARM GNU Toolchain to PATH
68+
run: echo "${{ env.ARM_TOOLCHAIN_PATH }}/bin" >> $GITHUB_PATH
5569

5670
- name: Checkout repository
5771
uses: actions/checkout@v4
5872
with:
5973
path: ${{ env.REPO_PATH }}
6074

75+
- name: Cache Gecko SDK
76+
id: cache-gecko-sdk
77+
uses: actions/cache@v4
78+
with:
79+
path: ${{ env.GECKO_SDK_PATH }}
80+
key: gecko-sdk-${{ env.GECKO_SDK_VERSION }}
81+
6182
- name: Download Gecko SDK
83+
if: steps.cache-gecko-sdk.outputs.cache-hit != 'true'
6284
run: |
63-
wget -nv https://github.com/SiliconLabs/gecko_sdk/releases/download/v4.4.5/gecko-sdk.zip
64-
unzip -q gecko-sdk.zip -d gecko_sdk
85+
wget -nv https://github.com/SiliconLabs/gecko_sdk/releases/download/${{ env.GECKO_SDK_VERSION }}/gecko-sdk.zip
86+
unzip -q gecko-sdk.zip -d ${{ env.GECKO_SDK_PATH }}
6587
6688
- name: "Download Simplicity Commander"
6789
run: |
@@ -76,18 +98,18 @@ jobs:
7698
7799
- name: Build bootloader
78100
run: |
101+
export ARM_GCC_DIR="${{ env.ARM_TOOLCHAIN_PATH }}"
102+
79103
cd ${{ env.BOOTLOADER_PATH }}
80104
${{ env.SLC_CLI_PATH }}/slc signature trust --sdk ${{ env.GECKO_SDK_PATH }}
81-
${{ env.SLC_CLI_PATH }}/slc configuration --sdk ${{ env.GECKO_SDK_PATH }}
82-
${{ env.SLC_CLI_PATH }}/slc configuration --gcc-toolchain /tmp/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
83-
${{ env.SLC_CLI_PATH }}/slc generate -p bootloader-${{ matrix.board }}.slcp -d bootloader_project -o cmake
105+
${{ env.SLC_CLI_PATH }}/slc generate -s ${{ env.GECKO_SDK_PATH }} -p bootloader-${{ matrix.board }}.slcp -d bootloader_project -o cmake
106+
84107
cd bootloader_project/bootloader_cmake
85108
cmake --workflow --preset project
86109
cmake --preset project && cmake --build --preset default_config
87110
88111
- name: Build firmware
89112
run: |
90-
export PATH=/tmp/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin:$PATH
91113
cd ${{ env.FIRMWARE_PATH }}
92114
cmake --preset ${{ matrix.board }} && cmake --build --preset ${{ matrix.board }}
93115

0 commit comments

Comments
 (0)