Skip to content

Commit d9a4449

Browse files
committed
Add CI workflow, run tests per-architecture before release
Separate ci.yml runs on push/PR. In release.yml, a ci job runs zig build, zig tests, and elixir tests on each architecture target. NIF builds only start after all ci jobs pass. Pipeline: ci (x86_64-linux + aarch64-macos) → build_nif → release
1 parent 1588898 commit d9a4449

2 files changed

Lines changed: 57 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
- os: macos-latest
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: mlugg/setup-zig@v2
21+
with:
22+
version: 0.15.2
23+
24+
- name: Build Zig library
25+
run: zig build -Doptimize=ReleaseFast
26+
27+
- name: Run Zig tests
28+
run: zig build test
29+
30+
- name: Set up Erlang/Elixir
31+
uses: erlef/setup-beam@v1
32+
with:
33+
otp-version: "27"
34+
elixir-version: "1.17"
35+
36+
- name: Run Elixir tests
37+
env:
38+
TAILWIND_COMPILER_PATH: "true"
39+
run: |
40+
mix local.hex --force
41+
mix local.rebar --force
42+
mix deps.get
43+
mix test

.github/workflows/release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
test:
13-
name: Test
14-
runs-on: ubuntu-22.04
12+
ci:
13+
name: CI (${{ matrix.target }})
14+
runs-on: ${{ matrix.runner }}
15+
strategy:
16+
fail-fast: true
17+
matrix:
18+
include:
19+
- target: x86_64-linux
20+
runner: ubuntu-22.04
21+
- target: aarch64-macos
22+
runner: macos-15
1523
steps:
1624
- uses: actions/checkout@v4
1725

18-
- name: Install Zig
19-
uses: mlugg/setup-zig@v2
26+
- uses: mlugg/setup-zig@v2
2027
with:
2128
version: 0.15.2
2229

@@ -43,7 +50,7 @@ jobs:
4350
4451
build_nif:
4552
name: Build NIF (${{ matrix.target }})
46-
needs: test
53+
needs: ci
4754
runs-on: ${{ matrix.runner }}
4855
strategy:
4956
fail-fast: true
@@ -134,7 +141,7 @@ jobs:
134141

135142
release:
136143
name: Create Release
137-
needs: [test, build_nif]
144+
needs: build_nif
138145
runs-on: ubuntu-latest
139146
steps:
140147
- name: Download all artifacts

0 commit comments

Comments
 (0)