66 pull_request :
77 branches : [main]
88
9+ # Cancel in-progress runs for the same branch/PR
10+ concurrency :
11+ group : ci-${{ github.ref }}
12+ cancel-in-progress : true
13+
914jobs :
1015 fmt-check :
1116 name : Format Check
1217 runs-on : ubuntu-latest
1318 steps :
1419 - uses : actions/checkout@v4
15- - uses : mlugg/setup-zig@v2
16- with :
17- version : 0.15.2
20+ - uses : DeterminateSystems/nix-installer-action@main
21+ - uses : DeterminateSystems/magic-nix-cache-action@main
1822 - name : Check formatting
19- run : zig fmt --check src/ tests/ bench/ build.zig
23+ run : nix develop .#ci --command zig fmt --check src/ tests/ bench/ build.zig
2024
2125 unit-tests :
2226 name : Unit Tests (${{ matrix.os }})
@@ -27,66 +31,53 @@ jobs:
2731 os : [ubuntu-latest, macos-latest]
2832 steps :
2933 - uses : actions/checkout@v4
30- - uses : mlugg/setup-zig@v2
31- with :
32- version : 0.15.2
34+ - uses : DeterminateSystems/nix-installer-action@main
35+ - uses : DeterminateSystems/magic-nix-cache-action@main
3336 - name : Run unit tests
34- run : zig build test --summary all
37+ run : nix develop .#ci --command zig build test --summary all
3538
3639 smoke-tests :
37- name : Smoke Tests
38- runs-on : ubuntu-latest
39- services :
40- opensearch :
41- image : opensearchproject/opensearch:2
42- ports :
43- - 9200:9200
44- env :
45- discovery.type : single-node
46- plugins.security.disabled : " true"
47- OPENSEARCH_INITIAL_ADMIN_PASSWORD : " Admin1234!"
48- options : >-
49- --health-cmd "curl -sf http://localhost:9200/_cluster/health || exit 1"
50- --health-interval 10s
51- --health-timeout 5s
52- --health-retries 20
40+ name : Smoke Tests (${{ matrix.os }})
41+ runs-on : ${{ matrix.os }}
42+ strategy :
43+ fail-fast : false
44+ matrix :
45+ os : [ubuntu-latest, macos-latest]
5346 steps :
5447 - uses : actions/checkout@v4
55- - uses : mlugg/setup-zig@v2
56- with :
57- version : 0.15.2
48+ - uses : DeterminateSystems/nix-installer-action@main
49+ - uses : DeterminateSystems/magic-nix-cache-action@main
50+ - name : Start OpenSearch
51+ run : nix develop .#ci --command es-start
5852 - name : Run smoke tests
59- run : zig build test-smoke --summary all
53+ run : nix develop .#ci --command zig build test-smoke --summary all
6054 env :
6155 ES_URL : http://localhost:9200
56+ - name : Stop OpenSearch
57+ if : always()
58+ run : nix develop .#ci --command es-stop
6259
6360 integration-tests :
64- name : Integration Tests
65- runs-on : ubuntu-latest
61+ name : Integration Tests (${{ matrix.os }})
62+ runs-on : ${{ matrix.os }}
6663 needs : [unit-tests]
67- services :
68- opensearch :
69- image : opensearchproject/opensearch:2
70- ports :
71- - 9200:9200
72- env :
73- discovery.type : single-node
74- plugins.security.disabled : " true"
75- OPENSEARCH_INITIAL_ADMIN_PASSWORD : " Admin1234!"
76- options : >-
77- --health-cmd "curl -sf http://localhost:9200/_cluster/health || exit 1"
78- --health-interval 10s
79- --health-timeout 5s
80- --health-retries 20
64+ strategy :
65+ fail-fast : false
66+ matrix :
67+ os : [ubuntu-latest, macos-latest]
8168 steps :
8269 - uses : actions/checkout@v4
83- - uses : mlugg/setup-zig@v2
84- with :
85- version : 0.15.2
70+ - uses : DeterminateSystems/nix-installer-action@main
71+ - uses : DeterminateSystems/magic-nix-cache-action@main
72+ - name : Start OpenSearch
73+ run : nix develop .#ci --command es-start
8674 - name : Run integration tests
87- run : zig build test-integration --summary all
75+ run : nix develop .#ci --command zig build test-integration --summary all
8876 env :
8977 ES_URL : http://localhost:9200
78+ - name : Stop OpenSearch
79+ if : always()
80+ run : nix develop .#ci --command es-stop
9081
9182 build-check :
9283 name : Build Check (${{ matrix.os }})
9788 os : [ubuntu-latest, macos-latest]
9889 steps :
9990 - uses : actions/checkout@v4
100- - uses : mlugg/setup-zig@v2
101- with :
102- version : 0.15.2
103- - name : Build (ReleaseSafe)
104- run : zig build -Doptimize=ReleaseSafe
91+ - uses : DeterminateSystems/nix-installer-action@main
92+ - uses : DeterminateSystems/magic-nix-cache-action@main
93+ - name : Nix build (reproducible)
94+ run : nix build
95+ - name : Nix flake check
96+ run : nix flake check
0 commit comments