|
| 1 | +name: Zephyr Build and Test |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build-zephyr: |
| 7 | + runs-on: ubuntu-22.04 |
| 8 | + container: |
| 9 | + image: ghcr.io/zephyrproject-rtos/ci:v0.26.4 |
| 10 | + options: '--entrypoint /bin/bash' |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + board: |
| 15 | + - qemu_cortex_m3 |
| 16 | + env: |
| 17 | + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.1 |
| 18 | + ZEPHYR_TOOLCHAIN_VARIANT: zephyr |
| 19 | + steps: |
| 20 | + - name: Apply container owner mismatch workaround |
| 21 | + run: | |
| 22 | + # FIXME: The owner UID of the GITHUB_WORKSPACE directory may not |
| 23 | + # match the container user UID because of the way GitHub |
| 24 | + # Actions runner is implemented. Remove this workaround when |
| 25 | + # GitHub comes up with a fundamental fix for this problem. |
| 26 | + git config --global --add safe.directory ${GITHUB_WORKSPACE} |
| 27 | +
|
| 28 | + - name: Update PATH for west |
| 29 | + run: | |
| 30 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 31 | +
|
| 32 | + - name: Configure Git |
| 33 | + run: | |
| 34 | + git config --global user.email [email protected] |
| 35 | + git config --global user.name "Github Actions" |
| 36 | +
|
| 37 | + - name: Setup Git (pull request) |
| 38 | + if: ${{ github.base_ref }} |
| 39 | + env: |
| 40 | + BASE_REF: ${{ github.base_ref }} |
| 41 | + run: | |
| 42 | + git rebase origin/${BASE_REF} |
| 43 | + git checkout -b this_pr |
| 44 | +
|
| 45 | + - name: Setup build system packages on Linux |
| 46 | + run: | |
| 47 | + sudo apt-get -y update |
| 48 | + sudo apt-get -y install nodejs |
| 49 | +
|
| 50 | + - name: Checkout |
| 51 | + uses: actions/checkout@v3 |
| 52 | + |
| 53 | + - name: West Setup |
| 54 | + run: | |
| 55 | + west init -l . || true |
| 56 | + west config --global update.narrow true |
| 57 | + west config --global build.board_warn false |
| 58 | + west update 2>&1 1> west.update.log || west update 2>&1 1> west.update.log |
| 59 | +
|
| 60 | + - name: Build the PR |
| 61 | + run: | |
| 62 | + west build -b ${{ matrix.board }} . |
0 commit comments