Skip to content

Commit 1588898

Browse files
committed
Add test job to release CI: Zig build + tests gate the release
Runs zig build, zig build test, and mix test before NIF builds start. Release only created if all tests and all NIF builds pass.
1 parent 29a3c91 commit 1588898

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,41 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
test:
13+
name: Test
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Zig
19+
uses: mlugg/setup-zig@v2
20+
with:
21+
version: 0.15.2
22+
23+
- name: Build Zig library
24+
run: zig build -Doptimize=ReleaseFast
25+
26+
- name: Run Zig tests
27+
run: zig build test
28+
29+
- name: Set up Erlang/Elixir
30+
uses: erlef/setup-beam@v1
31+
with:
32+
otp-version: "27"
33+
elixir-version: "1.17"
34+
35+
- name: Run Elixir tests
36+
env:
37+
TAILWIND_COMPILER_PATH: "true"
38+
run: |
39+
mix local.hex --force
40+
mix local.rebar --force
41+
mix deps.get
42+
mix test
43+
1244
build_nif:
1345
name: Build NIF (${{ matrix.target }})
46+
needs: test
1447
runs-on: ${{ matrix.runner }}
1548
strategy:
1649
fail-fast: true
@@ -101,7 +134,7 @@ jobs:
101134

102135
release:
103136
name: Create Release
104-
needs: build_nif
137+
needs: [test, build_nif]
105138
runs-on: ubuntu-latest
106139
steps:
107140
- name: Download all artifacts

0 commit comments

Comments
 (0)