ci: replace Docker image #612
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build native Zephyr samples | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build native Zephyr samples | |
runs-on: ubuntu-latest | |
container: zephyrprojectrtos/ci-base:latest | |
env: | |
CMAKE_PREFIX_PATH: /opt/toolchains | |
CCACHE_IGNOREOPTIONS: -specs=* | |
MODULE_PATH: ../modules/lib/ArduinoCore-zephyr | |
# action-setup-zephyr will initialize the repo in $GITHUB_WORKSPACE/.., | |
# so we need to put the module in $GITHUB_WORKSPACE's parent, but | |
# actions/checkout would not be able to checkout the module there | |
# directly, so we use "subfolder" and move it later. | |
# | |
# using action-setup-zephyr also requires a local west.yml and so the | |
# folder must be manually added to Zephyr as a module via | |
# EXTRA_ZEPHYR_MODULES. | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
path: subfolder | |
- name: Fix module path, list needed HALs | |
run: | | |
mkdir -p $(dirname $MODULE_PATH) && mv subfolder $MODULE_PATH | |
NEEDED_HALS=$(grep 'build.zephyr_hals=' $MODULE_PATH/boards.txt | cut -d '=' -f 2 | xargs -n 1 echo | sort -u) | |
HAL_FILTER="-hal_.*" | |
for hal in $NEEDED_HALS; do | |
HAL_FILTER="$HAL_FILTER,+$hal" | |
done | |
echo "HAL_FILTER=$HAL_FILTER" | tee -a $GITHUB_ENV | |
- name: Setup Zephyr project | |
uses: zephyrproject-rtos/action-zephyr-setup@v1 | |
with: | |
toolchains: arm-zephyr-eabi | |
manifest-file-name: ${{ env.MODULE_PATH }}/west.yml | |
west-project-filter: ${{ env.HAL_FILTER }} | |
enable-ccache: false | |
- name: Add manifest path as module | |
run: | | |
echo EXTRA_ZEPHYR_MODULES="$(pwd)/$MODULE_PATH" >> $GITHUB_ENV | |
- name: Build fade | |
run: | | |
west build -p -b arduino_nano_33_ble//sense $MODULE_PATH/samples/fade | |
- name: Build i2cdemo | |
run: | | |
west build -p -b ek_ra8d1 $MODULE_PATH/samples/i2cdemo | |
- name: Build adc | |
run: | | |
west build -p -b arduino_nano_33_ble/nrf52840/sense $MODULE_PATH/samples/analog_input |