add west cache #31
Workflow file for this run
This file contains 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 Demo | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
container: ghcr.io/zephyrproject-rtos/ci:v0.26.2 | |
env: | |
CMAKE_PREFIX_PATH: /opt/toolchains | |
ZEPHYR_VERSION: v3.6-branch | |
# Board to use with renode | |
BOARD: nrf52833dk_nrf52833 | |
strategy: | |
matrix: | |
board: ["esp32", "nrf52833dk_nrf52833"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# Cache the west workspace | |
- name: Cache west workspace | |
id: cache-west | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/west | |
key: ${{ runner.os }}-west-${{ hashFiles('**/west.yml') }} | |
restore-keys: | | |
${{ runner.os }}-west- | |
# Only run initialization if the cache was not restored | |
- name: Initialize | |
if: steps.cache-west.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p /tmp/west | |
cd /tmp/west | |
west init | |
west update -o=--depth=1 -n | |
# Matrix-specific build step | |
- name: Build PoC | |
working-directory: /tmp/west | |
run: | | |
west build $GITHUB_WORKSPACE/samples/demo -b ${{ matrix.board }} --build-dir $GITHUB_WORKSPACE/build |