Skip to content

Commit be006ff

Browse files
committed
ci: build: optimizations to make builds more robust
Take inspiration from the Arduino's fork [1] to improve the CI for building and testing samples in the project Signed-off-by: Dhruva Gole <[email protected]>
1 parent b96e3b1 commit be006ff

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,43 @@ jobs:
1212
docker volume prune -f
1313
1414
build:
15+
name: Build Arduino-API Zephyr samples
1516
runs-on: ubuntu-latest
16-
container: zephyrprojectrtos/ci:latest
17+
container: zephyrprojectrtos/ci-base:latest
1718
env:
1819
CMAKE_PREFIX_PATH: /opt/toolchains
20+
CCACHE_IGNOREOPTIONS: -specs=*
21+
MODULE_PATH: ../modules/lib/ArduinoCore-zephyr
22+
1923
steps:
2024
- name: Checkout
2125
uses: actions/checkout@v4
2226
with:
23-
path: Arduino-Zephyr-API
27+
fetch-depth: 0
28+
persist-credentials: false
29+
path: subfolder
30+
31+
- name: Fix module path, list needed HALs
32+
run: |
33+
mkdir -p $(dirname $MODULE_PATH) && mv subfolder $MODULE_PATH
34+
NEEDED_HALS=$(grep 'build.zephyr_hals=' $MODULE_PATH/boards.txt | cut -d '=' -f 2 | xargs -n 1 echo | sort -u)
35+
HAL_FILTER="-hal_.*"
36+
for hal in $NEEDED_HALS; do
37+
HAL_FILTER="$HAL_FILTER,+$hal"
38+
done
39+
echo "HAL_FILTER=$HAL_FILTER" | tee -a $GITHUB_ENV
40+
41+
- name: Setup Zephyr project
42+
uses: zephyrproject-rtos/action-zephyr-setup@v1
43+
with:
44+
toolchains: arm-zephyr-eabi
45+
manifest-file-name: ${{ env.MODULE_PATH }}/west.yml
46+
west-project-filter: ${{ env.HAL_FILTER }}
47+
enable-ccache: false
2448

25-
- name: Initialize
49+
- name: Add manifest path as module
2650
run: |
27-
west init -l Arduino-Zephyr-API/
28-
west update
29-
git clone https://github.com/arduino/ArduinoCore-API.git ArduinoCore-API
30-
mkdir -p modules/lib
31-
ln -s Arduino-Zephyr-API modules/lib/
32-
cp -rfp ArduinoCore-API/api Arduino-Zephyr-API/cores/arduino/
51+
echo EXTRA_ZEPHYR_MODULES="$(pwd)/$MODULE_PATH" >> $GITHUB_ENV
3352
3453
- name: Build fade
3554
working-directory: Arduino-Zephyr-API

0 commit comments

Comments
 (0)