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: Package, test and upload | |
| on: [push, pull_request] | |
| jobs: | |
| package-core: | |
| runs-on: ubuntu-latest | |
| env: | |
| ZEPHYR_SDK_INSTALL_DIR: /opt/zephyr-sdk-0.16.8 | |
| outputs: | |
| CORE_TAG: ${{ env.CORE_TAG }} | |
| ARTIFACT_NAME: ${{ env.ARTIFACT_NAME }} | |
| FQBNS: ${{ env.FQBNS }} | |
| steps: | |
| - name: Install toolchain | |
| working-directory: /opt | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends git cmake wget python3-pip ninja-build | |
| wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/zephyr-sdk-0.16.8_linux-x86_64_minimal.tar.xz | |
| tar xf zephyr-sdk-0.16.8_linux-x86_64_minimal.tar.xz && cd zephyr-sdk-0.16.8 && ./setup.sh -t arm-zephyr-eabi -c | |
| - uses: actions/checkout@v4 | |
| - name: Initialize | |
| id: init | |
| run: | | |
| ./extra/bootstrap.sh | |
| echo "CORE_TAG=$(git describe --always)" >> "$GITHUB_ENV" | |
| echo "ARTIFACT_NAME=ArduinoCore-zephyr-$(git describe --always)" >> "$GITHUB_ENV" | |
| echo "FQBNS=[ $(cat boards.txt | grep '^[^#]*\.build\.variant' | cut -d '.' -f 1 | xargs printf '"%s",' | sed -e 's/,$//') ]" >> "$GITHUB_ENV" | |
| - name: Build | |
| run: ./extra/build_all.sh -f | |
| - name: Package | |
| run: | | |
| ./extra/package.sh ${{ env.CORE_TAG }} | |
| mv ../${{ env.ARTIFACT_NAME }}.tar.bz2 . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: ${{ env.ARTIFACT_NAME }}.tar.bz2 | |
| test-core: | |
| runs-on: ubuntu-latest | |
| needs: package-core | |
| strategy: | |
| matrix: | |
| fqbn: ${{ fromJSON( needs.package-core.outputs.FQBNS ) }} | |
| fail-fast: false | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| - name: Set up core | |
| run: | | |
| unzip ArduinoCore-zephyr-${{ needs.package-core.outputs.CORE_TAG }}.zip | |
| tar xf ArduinoCore-zephyr-${{ needs.package-core.outputs.CORE_TAG }}.tar.bz2 | |
| - name: Create Blink sketch | |
| run: | | |
| mkdir Blink/ | |
| wget https://raw.githubusercontent.com/arduino/arduino-examples/refs/heads/main/examples/01.Basics/Blink/Blink.ino -P Blink/ | |
| - name: Compile Blink for ${{ matrix.fqbn }} | |
| uses: arduino/compile-sketches@main | |
| with: | |
| fqbn: arduino:zephyr:${{ matrix.fqbn }} | |
| platforms: | | |
| # Use Board Manager to install the latest release of Arduino Zephyr Boards to get the toolchain | |
| - name: "arduino:zephyr" | |
| source-url: "https://downloads.arduino.cc/packages/package_zephyr_index.json" | |
| - name: "arduino:zephyr" | |
| source-path: "ArduinoCore-zephyr" | |
| sketch-paths: Blink | |
| verbose: 'false' | |
| enable-deltas-report: 'false' | |
| publish-artifacts: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - package-core | |
| - test-core | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| - name: Extract artifact | |
| run: | | |
| unzip ArduinoCore-zephyr-${{ needs.package-core.outputs.CORE_TAG }}.zip | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
| role-session-name: "github_${{ env.PROJECT_NAME }}" | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Upload to Arduino download server | |
| run: aws s3 sync ArduinoCore-zephyr-${{ needs.package-core.outputs.CORE_TAG }}.tar.bz2 s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }}nightly |