2023-11-04 02:18:58 +08:00
|
|
|
name: Hello World (Multiplatform)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- v*-branch
|
|
|
|
- collab-*
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- v*-branch
|
|
|
|
- collab-*
|
|
|
|
paths:
|
|
|
|
- 'scripts/build/**'
|
|
|
|
- 'scripts/requirements*.txt'
|
|
|
|
- '.github/workflows/hello_world_multiplatform.yaml'
|
2024-02-01 17:43:05 +08:00
|
|
|
- 'SDK_VERSION'
|
2023-11-04 02:18:58 +08:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-05-29 23:39:34 +08:00
|
|
|
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, windows-2022]
|
2023-11-04 02:18:58 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-02-01 17:46:38 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-11-04 02:18:58 +08:00
|
|
|
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"
|
|
|
|
git rebase origin/${BASE_REF}
|
2024-09-17 15:39:16 +08:00
|
|
|
git clean -f -d
|
2023-11-04 02:18:58 +08:00
|
|
|
git log --graph --oneline HEAD...${PR_HEAD}
|
|
|
|
|
|
|
|
- name: Set up Python
|
2024-03-05 19:57:57 +08:00
|
|
|
uses: actions/setup-python@v5
|
2023-11-04 02:18:58 +08:00
|
|
|
with:
|
|
|
|
python-version: 3.11
|
|
|
|
|
|
|
|
- name: Setup Zephyr project
|
|
|
|
uses: zephyrproject-rtos/action-zephyr-setup@v1
|
|
|
|
with:
|
|
|
|
app-path: zephyr
|
|
|
|
toolchains: all
|
|
|
|
|
|
|
|
- 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"
|
|
|
|
fi
|
2024-09-18 16:20:04 +08:00
|
|
|
./scripts/twister --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS
|
2023-11-04 02:18:58 +08:00
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
if: failure()
|
2024-02-01 17:46:38 +08:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-11-04 02:18:58 +08:00
|
|
|
with:
|
|
|
|
if-no-files-found: ignore
|
|
|
|
path:
|
|
|
|
zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log
|
2024-09-18 16:20:04 +08:00
|
|
|
zephyr/twister-out/*/samples/cpp/hello_world/sample.cpp.helloworld/build.log
|