Build samples #58
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 samples | |
on: | |
pull_request: | |
push: | |
schedule: | |
# Run at 03:00 UTC on every Sunday | |
- cron: '0 3 * * 0' | |
release: | |
types: | |
- created | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
container: ghcr.io/zephyrproject-rtos/ci-base:v0.26.4 | |
env: | |
ZEPHYR_SDK_VERSION: 0.16.1 | |
steps: | |
- name: Install Zephyr SDK with arm-zephyr-eabi only | |
run: | | |
cd $HOME | |
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ env.ZEPHYR_SDK_VERSION }}/zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}_linux-x86_64_minimal.tar.xz | |
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ env.ZEPHYR_SDK_VERSION }}/sha256.sum | shasum --check --ignore-missing | |
tar xvf zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}_linux-x86_64_minimal.tar.xz | |
rm zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}_linux-x86_64_minimal.tar.xz | |
cd $HOME/zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }} | |
./setup.sh -t arm-zephyr-eabi -h -c | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
path: ncs-playground | |
- name: Get the version | |
id: get_version | |
working-directory: ncs-playground | |
run: echo "VERSION=$(git describe --always --tags)" >> $GITHUB_OUTPUT | |
- name: Initialize | |
working-directory: ncs-playground | |
run: | | |
west init -l . | |
west update | |
- name: Build samples | |
working-directory: ncs-playground | |
run: | | |
west twister --integration -v --inline-logs -T samples | |
- name: Tar firmware | |
working-directory: ncs-playground/twister-out | |
run: | | |
find . \( -name zephyr.uf2 -or -name zephyr.hex \) -print0 | tar -cvf ncs-playground-samples-${{ steps.get_version.outputs.VERSION }}.tar --null -T - | |
- name: Upload firmware | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ncs-playground-samples-${{ steps.get_version.outputs.VERSION }} | |
path: | | |
ncs-playground/twister-out/ncs-playground-samples-${{ steps.get_version.outputs.VERSION }}.tar | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
files: | | |
ncs-playground/twister-out/ncs-playground-samples-${{ steps.get_version.outputs.VERSION }}.tar |