18
18
GECKO_SDK_PATH : ${{ github.workspace }}/gecko_sdk
19
19
SIMPLICITY_COMMANDER_PATH : ${{ github.workspace }}/commander
20
20
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
21
24
22
25
jobs :
23
26
build :
30
33
steps :
31
34
- name : Install build dependencies
32
35
run : |
36
+ export DEBIAN_FRONTEND=noninteractive
33
37
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
35
39
36
40
- name : Set up Python
37
41
uses : actions/setup-python@v5
@@ -47,21 +51,39 @@ jobs:
47
51
distribution : " temurin"
48
52
java-version : " 17"
49
53
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'
51
63
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
55
69
56
70
- name : Checkout repository
57
71
uses : actions/checkout@v4
58
72
with :
59
73
path : ${{ env.REPO_PATH }}
60
74
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
+
61
82
- name : Download Gecko SDK
83
+ if : steps.cache-gecko-sdk.outputs.cache-hit != 'true'
62
84
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 }}
65
87
66
88
- name : " Download Simplicity Commander"
67
89
run : |
@@ -76,18 +98,18 @@ jobs:
76
98
77
99
- name : Build bootloader
78
100
run : |
101
+ export ARM_GCC_DIR="${{ env.ARM_TOOLCHAIN_PATH }}"
102
+
79
103
cd ${{ env.BOOTLOADER_PATH }}
80
104
${{ 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
+
84
107
cd bootloader_project/bootloader_cmake
85
108
cmake --workflow --preset project
86
109
cmake --preset project && cmake --build --preset default_config
87
110
88
111
- name : Build firmware
89
112
run : |
90
- export PATH=/tmp/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin:$PATH
91
113
cd ${{ env.FIRMWARE_PATH }}
92
114
cmake --preset ${{ matrix.board }} && cmake --build --preset ${{ matrix.board }}
93
115
0 commit comments