name: Hello World (Multiplatform) on: push: branches: - main - v*-branch - collab-* pull_request: branches: - main - v*-branch - collab-* paths: - 'scripts/**' - '.github/workflows/hello_world_multiplatform.yaml' - 'SDK_VERSION' permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} cancel-in-progress: true jobs: build: strategy: fail-fast: false matrix: os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: path: zephyr fetch-depth: 0 - name: Rebase if: github.event_name == 'pull_request' env: BASE_REF: ${{ github.base_ref }} PR_HEAD: ${{ github.event.pull_request.head.sha }} working-directory: zephyr shell: bash run: | git config --global user.email "actions@zephyrproject.org" git config --global user.name "Github Actions" rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --graph --oneline HEAD...${PR_HEAD} - name: Set up Python uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: 3.12 - name: Setup Zephyr project uses: zephyrproject-rtos/action-zephyr-setup@c125c5ebeeadbd727fa740b407f862734af1e52a # v1.0.9 with: app-path: zephyr toolchains: aarch64-zephyr-elf:arc-zephyr-elf:arc64-zephyr-elf:arm-zephyr-eabi:mips-zephyr-elf:riscv64-zephyr-elf:sparc-zephyr-elf:x86_64-zephyr-elf:xtensa-dc233c_zephyr-elf:xtensa-sample_controller32_zephyr-elf:rx-zephyr-elf ccache-cache-key: hw-${{ matrix.os }} - name: Build firmware working-directory: zephyr shell: bash run: | if [ "${{ runner.os }}" = "macOS" ]; then EXTRA_TWISTER_FLAGS="-P native_sim --build-only" elif [ "${{ runner.os }}" = "Windows" ]; then EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out" elif [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then EXTRA_TWISTER_FLAGS="--exclude-platform native_sim/native" fi west twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS - name: Upload artifacts if: failure() uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: if-no-files-found: ignore path: zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log zephyr/twister-out/*/samples/cpp/hello_world/sample.cpp.helloworld/build.log