1name: Hello World (Multiplatform) 2 3on: 4 push: 5 branches: 6 - main 7 - v*-branch 8 - collab-* 9 pull_request: 10 branches: 11 - main 12 - v*-branch 13 - collab-* 14 paths: 15 - 'scripts/**' 16 - '.github/workflows/hello_world_multiplatform.yaml' 17 - 'SDK_VERSION' 18 19permissions: 20 contents: read 21 22concurrency: 23 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} 24 cancel-in-progress: true 25 26jobs: 27 build: 28 strategy: 29 fail-fast: false 30 matrix: 31 os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2022] 32 runs-on: ${{ matrix.os }} 33 steps: 34 - name: Checkout 35 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 36 with: 37 path: zephyr 38 fetch-depth: 0 39 40 - name: Rebase 41 if: github.event_name == 'pull_request' 42 env: 43 BASE_REF: ${{ github.base_ref }} 44 PR_HEAD: ${{ github.event.pull_request.head.sha }} 45 working-directory: zephyr 46 shell: bash 47 run: | 48 git config --global user.email "actions@zephyrproject.org" 49 git config --global user.name "Github Actions" 50 rm -fr ".git/rebase-apply" 51 rm -fr ".git/rebase-merge" 52 git rebase origin/${BASE_REF} 53 git clean -f -d 54 git log --graph --oneline HEAD...${PR_HEAD} 55 56 - name: Set up Python 57 uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 58 with: 59 python-version: 3.12 60 61 - name: Setup Zephyr project 62 uses: zephyrproject-rtos/action-zephyr-setup@c125c5ebeeadbd727fa740b407f862734af1e52a # v1.0.9 63 with: 64 app-path: zephyr 65 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 66 ccache-cache-key: hw-${{ matrix.os }} 67 68 - name: Build firmware 69 working-directory: zephyr 70 shell: bash 71 run: | 72 if [ "${{ runner.os }}" = "macOS" ]; then 73 EXTRA_TWISTER_FLAGS="-P native_sim --build-only" 74 elif [ "${{ runner.os }}" = "Windows" ]; then 75 EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out" 76 elif [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then 77 EXTRA_TWISTER_FLAGS="--exclude-platform native_sim/native" 78 fi 79 west twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS 80 81 - name: Upload artifacts 82 if: failure() 83 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 84 with: 85 if-no-files-found: ignore 86 path: 87 zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log 88 zephyr/twister-out/*/samples/cpp/hello_world/sample.cpp.helloworld/build.log 89