-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: add a multiplatform hello world workflow
Add a new workflow to build the hello world sample application on all three supported platforms using the reusable setup action. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
- Loading branch information
1 parent
e1a5605
commit e044b08
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Hello World (Multiplatform) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v*-branch | ||
- collab-* | ||
pull_request: | ||
branches: | ||
- main | ||
- v*-branch | ||
- collab-* | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
path: zephyr | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Setup Zephyr project | ||
uses: fabiobaltieri/zephyr-setup@main | ||
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_posix --build-only" | ||
elif [ "${{ runner.os }}" = "Windows" ]; then | ||
EXTRA_TWISTER_FLAGS="-P native_posix --short-build-path -O/tmp/twister-out" | ||
fi | ||
west twister -T samples/hello_world -v $EXTRA_TWISTER_FLAGS | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
if-no-files-found: ignore | ||
path: | ||
zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log |