Skip to content

Commit 43870f5

Browse files
authored
Refactor Actions (#329)
* refactor actions * add name * add names * add reusable step * wip * wip * wip * wip * wip * add matrices * wip * env * wip * wip
1 parent f6bd248 commit 43870f5

3 files changed

Lines changed: 158 additions & 112 deletions

File tree

.github/workflows/build.yml

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

.github/workflows/ci.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main, zig-master]
5+
pull_request:
6+
branches: [main, zig-master]
7+
8+
9+
env:
10+
ZIG_VERSION: ${{ github.ref == 'refs/heads/zig-master' && 'master' || '0.13.0' }}
11+
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Setup Zig
20+
uses: mlugg/setup-zig@v1
21+
with:
22+
version: ${{ env.ZIG_VERSION }}
23+
- name: Build
24+
run: zig build -Doptimize=ReleaseSmall
25+
26+
unit-test-ports:
27+
name: Unit Test Ports
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
matrix:
31+
os: [
32+
ubuntu-latest,
33+
windows-latest,
34+
macos-latest,
35+
]
36+
port_dir: [
37+
gigadevice/gd32,
38+
raspberrypi/rp2xxx,
39+
stmicro/stm32,
40+
]
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
- name: Setup Zig
45+
uses: mlugg/setup-zig@v1
46+
with:
47+
version: ${{ env.ZIG_VERSION }}
48+
- name: Unit Test Ports
49+
run: zig build test
50+
working-directory: port/${{ matrix.port_dir }}
51+
52+
unit-test-regz:
53+
name: Unit Test Regz
54+
strategy:
55+
matrix:
56+
os: [
57+
ubuntu-latest,
58+
windows-latest,
59+
macos-latest,
60+
]
61+
runs-on: ${{ matrix.os }}
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
- name: Setup Zig
66+
uses: mlugg/setup-zig@v1
67+
with:
68+
version: ${{ env.ZIG_VERSION }}
69+
- name: Unit Test Regz
70+
run: zig build test
71+
working-directory: tools/regz
72+
73+
unit-test-uf2:
74+
name: Unit Test UF2
75+
strategy:
76+
matrix:
77+
os: [
78+
ubuntu-latest,
79+
windows-latest,
80+
macos-latest,
81+
]
82+
runs-on: ${{ matrix.os }}
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
- name: Setup Zig
87+
uses: mlugg/setup-zig@v1
88+
with:
89+
version: ${{ env.ZIG_VERSION }}
90+
- name: Unit Test UF2
91+
run: zig build test
92+
working-directory: tools/uf2
93+
94+
build-website:
95+
name: Build Website
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
- name: Setup Zig
101+
uses: mlugg/setup-zig@v1
102+
with:
103+
version: ${{ env.ZIG_VERSION }}
104+
- name: Build Website
105+
run: zig build
106+
working-directory: website
107+
108+
dry-run-packaging:
109+
name: Dry Run Packaging
110+
runs-on: macos-latest
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
- name: Setup Zig
115+
uses: mlugg/setup-zig@v1
116+
with:
117+
version: ${{ env.ZIG_VERSION }}
118+
- name: Dry Run Packaging
119+
run: |
120+
MICROZIG_VERSION=$(zig build package -- get-version)
121+
echo microzig version: $MICROZIG_VERSION
122+
zig build package -- http://localhost:8000
123+
python3 -m http.server 8000 --directory boxzer-out &
124+
sleep 1
125+
126+
cd tools/package-test
127+
zig fetch --save=microzig http://localhost:8000/${MICROZIG_VERSION}/microzig.tar.gz
128+
zig build -Doptimize=ReleaseSmall
129+
130+
jobs -p | xargs kill
131+
132+
build-examples:
133+
name: Build Examples
134+
runs-on: ubuntu-latest
135+
strategy:
136+
matrix:
137+
example_dir: [
138+
espressif/esp,
139+
gigadevice/gd32,
140+
microchip/avr,
141+
microchip/atsam,
142+
nordic/nrf5x,
143+
nxp/lpc,
144+
stmicro/stm32,
145+
raspberrypi/rp2xxx,
146+
wch/ch32v,
147+
]
148+
steps:
149+
- name: Checkout
150+
uses: actions/checkout@v4
151+
- name: Setup Zig
152+
uses: mlugg/setup-zig@v1
153+
with:
154+
version: ${{ env.ZIG_VERSION }}
155+
- name: Build Examples
156+
run: zig build -Doptimize=ReleaseSmall --summary all
157+
working-directory: examples/${{ matrix.example_dir }}
158+

.github/workflows/examples.yml

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

0 commit comments

Comments
 (0)