Skip to content

Commit 7e43c41

Browse files
Update build workflow to use official Zephyr setup action and restrict OS matrix to Windows
1 parent 07adbca commit 7e43c41

File tree

2 files changed

+54
-260
lines changed

2 files changed

+54
-260
lines changed

.github/actions/setup-zephyr/action.yml

Lines changed: 0 additions & 252 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ on:
99
permissions:
1010
contents: read
1111

12+
env:
13+
ZEPHYR_SDK_VERSION: 0.17.4
14+
ZEPHYR_TOOLCHAINS: |
15+
arm-zephyr-eabi
16+
xtensa-espressif_esp32s3_zephyr-elf
17+
1218
jobs:
1319
build:
1420
name: Build app and tests
1521
strategy:
1622
fail-fast: false
1723
matrix:
18-
os: [ubuntu-22.04, macos-26, windows-2022]
24+
os: [windows-2022]
1925
runs-on: ${{ matrix.os }}
2026
steps:
2127
- name: Checkout
@@ -25,16 +31,56 @@ jobs:
2531
persist-credentials: false
2632

2733
- name: Set up Python
28-
uses: actions/setup-python@v5
34+
uses: actions/setup-python@v6
2935
with:
3036
python-version: 3.12
37+
cache: 'pip'
38+
39+
- name: Install system dependencies
40+
shell: bash
41+
run: |
42+
if [ "${{ runner.os }}" = "Linux" ]; then
43+
sudo rm -f /var/lib/man-db/auto-update
44+
sudo apt-get update -y
45+
sudo apt-get install -y ninja-build ccache gperf
46+
if [ "${{ runner.arch }}" = "X64" ]; then
47+
sudo apt-get install -y libc6-dev-i386 g++-multilib
48+
fi
49+
elif [ "${{ runner.os }}" = "macOS" ]; then
50+
brew install ninja ccache qemu dtc gperf
51+
elif [ "${{ runner.os }}" = "Windows" ]; then
52+
choco feature enable -n allowGlobalConfirmation
53+
choco install ninja wget gperf
54+
fi
3155
32-
- name: Setup Zephyr project
33-
uses: ./OpenAstroFocuser/.github/actions/setup-zephyr
56+
- name: Install west
57+
shell: bash
58+
run: |
59+
pip install west
60+
61+
- name: Initialize Zephyr workspace
62+
shell: bash
63+
run: |
64+
west init -l OpenAstroFocuser
65+
west update
66+
67+
- name: Install pip dependencies
68+
shell: bash
69+
run: |
70+
west packages pip --install --ignore-venv-check || pip3 install -r zephyr/scripts/requirements.txt
71+
72+
- name: Zephyr SDK cache
73+
uses: actions/cache@v5
3474
with:
35-
app-path: OpenAstroFocuser
36-
toolchains: arm-zephyr-eabi:xtensa-espressif_esp32s3_zephyr-elf
37-
ccache-cache-key: ${{ matrix.os }}
75+
path: ~/zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}
76+
key: zephyr-sdk-${{ env.ZEPHYR_SDK_VERSION }}-${{ matrix.os }}
77+
78+
- name: Install Zephyr SDK
79+
if: steps.cache.outputs.cache-hit != 'true'
80+
shell: bash
81+
run: |
82+
TOOLCHAINS="$(echo "${{ env.ZEPHYR_TOOLCHAINS }}" | xargs)"
83+
west sdk install --version ${{ env.ZEPHYR_SDK_VERSION }} -t ${TOOLCHAINS}
3884
3985
- name: Build firmware
4086
working-directory: OpenAstroFocuser
@@ -52,4 +98,4 @@ jobs:
5298
if [ "${{ runner.os }}" = "Windows" ]; then
5399
EXTRA_TWISTER_FLAGS="--short-build-path -O/tmp/twister-out"
54100
fi
55-
west twister -T tests -v --inline-logs --integration $EXTRA_TWISTER_FLAGS
101+
west twister -T tests -v --inline-logs --integration $EXTRA_TWISTER_FLAGS

0 commit comments

Comments
 (0)