Skip to content

Commit c5039a7

Browse files
committed
ci: replace ci docker image with ci-base + action-setup-zephyr
The Github runner is now more limited and does not accept the standard zephyrprojectrtos/ci image. Use the ci-base image and manually install the few extra dependencies we need via action-setup-zephyr. This brings an additional path issue: the west workspace will be initialized in $GITHUB_WORKSPACE/.., so we need to move the repo checkout to a subfolder and then move it to the right place.
1 parent 3ac4639 commit c5039a7

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,50 @@ jobs:
66
build:
77
name: Build native Zephyr samples
88
runs-on: ubuntu-latest
9-
container: zephyrprojectrtos/ci:latest
9+
container: zephyrprojectrtos/ci-base:latest
1010
env:
1111
CMAKE_PREFIX_PATH: /opt/toolchains
1212
CCACHE_IGNOREOPTIONS: -specs=*
13-
REPOSITORY: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
14-
BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
13+
MODULE_PATH: ../modules/lib/ArduinoCore-zephyr
14+
15+
# action-setup-zephyr will initialize the repo in $GITHUB_WORKSPACE/..,
16+
# so we need to put the module in $GITHUB_WORKSPACE's parent, but
17+
# actions/checkout would not be able to checkout the module there
18+
# directly, so we use "subfolder" and move it later.
19+
#
20+
# using action-setup-zephyr also requires a local west.yml and so the
21+
# folder must be manually added to Zephyr as a module via
22+
# EXTRA_ZEPHYR_MODULES.
23+
1524
steps:
16-
- name: Initialize
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
path: subfolder
30+
31+
- name: Fix module path
1732
run: |
18-
mkdir build && cd build
19-
west init -m https://github.com/${{ env.REPOSITORY }} --mr ${{ env.BRANCH }}
20-
west update -o=--filter=tree:0
33+
mkdir -p $(dirname $MODULE_PATH) && mv subfolder $MODULE_PATH
2134
22-
- name: ccache
23-
uses: hendrikmuhs/ccache-action@v1.2
35+
- name: Setup Zephyr project
36+
uses: zephyrproject-rtos/action-zephyr-setup@v1
2437
with:
25-
verbose: 1
38+
toolchains: arm-zephyr-eabi
39+
manifest-file-name: ${{ env.MODULE_PATH }}/west.yml
40+
41+
- name: Add manifest path as module
42+
run: |
43+
echo EXTRA_ZEPHYR_MODULES="$(pwd)/$MODULE_PATH" >> $GITHUB_ENV
2644
2745
- name: Build fade
28-
working-directory: build
2946
run: |
30-
west build -p -b arduino_nano_33_ble//sense modules/lib/ArduinoCore-zephyr/samples/fade
47+
west build -p -b arduino_nano_33_ble//sense $MODULE_PATH/samples/fade
3148
3249
- name: Build i2cdemo
33-
working-directory: build
3450
run: |
35-
west build -p -b ek_ra8d1 modules/lib/ArduinoCore-zephyr/samples/i2cdemo
51+
west build -p -b ek_ra8d1 $MODULE_PATH/samples/i2cdemo
3652
3753
- name: Build adc
38-
working-directory: build
3954
run: |
40-
west build -p -b arduino_nano_33_ble/nrf52840/sense modules/lib/ArduinoCore-zephyr/samples/analog_input
55+
west build -p -b arduino_nano_33_ble/nrf52840/sense $MODULE_PATH/samples/analog_input

0 commit comments

Comments
 (0)