Skip to content

Commit 32bf5f9

Browse files
committed
chore(ci): switch CI to nix
1 parent f67835e commit 32bf5f9

File tree

13 files changed

+641
-228
lines changed

13 files changed

+641
-228
lines changed

.github/actionlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
self-hosted-runner:
2+
labels:
3+
- nix
4+
- nixos

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ github_actions:
44
c-api:
55
- changed-files:
66
- any-glob-to-any-file: "capi/**/*"
7-
python-capi:
7+
python-api:
88
- changed-files:
99
- any-glob-to-any-file: "pyapi/**/*"
1010
encodings:

.github/workflows/ci.yml

Lines changed: 90 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- msrv-build
2020
- code-quality
2121
- python-api
22-
- docs
22+
- doc
2323
- cadical-each-feature
2424
- kissat-each-feature
2525
- cadical-valgrind
@@ -35,7 +35,7 @@ jobs:
3535
echo "🏗️ MSRV build: ${{ needs.msrv-build.result }}"
3636
echo "✨ Code Quality: ${{ needs.code-quality.result }}"
3737
echo "🐍 Python API: ${{ needs.python-api.result }}"
38-
echo "📑 Check documentation: ${{ needs.docs.result }}"
38+
echo "📑 Check documentation: ${{ needs.doc.result }}"
3939
echo "🧪 CaDiCaL test each feature: ${{ needs.cadical-each-feature.result }}"
4040
echo "🧪 Kissat test each feature: ${{ needs.kissat-each-feature.result }}"
4141
echo "🤖 CaDiCaL Valgrind: ${{ needs.cadical-valgrind.result }}"
@@ -55,7 +55,7 @@ jobs:
5555
run: exit 1
5656
- if: ${{ needs.python-api.result != 'success' }}
5757
run: exit 1
58-
- if: ${{ needs.docs.result != 'success' }}
58+
- if: ${{ needs.doc.result != 'success' }}
5959
run: exit 1
6060
- if: ${{ needs.cadical-each-feature.result == 'failure' }}
6161
run: exit 1
@@ -71,114 +71,166 @@ jobs:
7171
run: exit 1
7272
- if: ${{ needs.capi-valgrind.result == 'failure' }}
7373
run: exit 1
74+
dev-deps:
75+
name: 🏗️ Dev dependencies
76+
runs-on: [self-hosted, nix]
77+
steps:
78+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
79+
- name: 🏗️ Build dev dependencies
80+
run: nix build .#devDeps
7481
tests:
7582
name: 🧪 Workspace tests
76-
runs-on: self-hosted
83+
runs-on: [self-hosted, nix]
84+
needs:
85+
- dev-deps
7786
steps:
7887
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
7988
- name: 🧪 Run tests
80-
run: just test-ci
89+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').tests"
90+
- name: 🧪 Run tests for external solver CaDiCaL
91+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').externalCadical"
92+
- name: 🧪 Run tests for external solver Kissat
93+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').externalKissat"
94+
- name: 🧪 Run tests for external solver Gimsatul
95+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').externalGimsatul"
8196
msrv-build:
8297
name: 🏗️ MSRV build
83-
runs-on: self-hosted
98+
runs-on: [self-hosted, nix]
8499
steps:
85100
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
86-
- name: 🏗️ Build
87-
run: just msrv-ci
101+
- name: 🏗️ Check MSRV builds
102+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').msrv"
88103
code-quality:
89104
name: ✨ Code Quality
90-
runs-on: self-hosted
105+
runs-on: [self-hosted, nix]
106+
needs:
107+
- dev-deps
91108
steps:
92109
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
93-
- name: ✨ Run code quality checks
94-
run: just code-quality-ci
110+
- name: ✨ Check formatting
111+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').treefmt"
112+
- name: ✨ Check typos
113+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').typos"
114+
- name: ✨ Check spelling
115+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').spellcheck"
116+
- name: ✨ Check generated readmes
117+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').readmes"
118+
- name: ✨ Check generated code
119+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').codegen"
95120
python-api:
96121
name: 🐍 Python API
97-
runs-on: self-hosted
122+
runs-on: [self-hosted, nix]
98123
steps:
99124
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
100-
- name: ✨ Run Python API checks
101-
run: just python-api-ci
102-
docs:
125+
- uses: actions/checkout@v4
126+
- name: ✨ Build Python API and check
127+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').pyapi"
128+
doc:
103129
name: 📑 Check documentation
104-
runs-on: self-hosted
130+
runs-on: [self-hosted, nix]
131+
needs:
132+
- dev-deps
105133
steps:
106134
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
107-
- name: ✨ Run docs checks
108-
run: just docs-ci
135+
- uses: actions/checkout@v4
136+
- name: ✨ Build doc
137+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').doc"
138+
- name: 🧪 Run doc tests
139+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').docTests"
109140
coverage:
110141
name: 📋 Test coverage
111-
runs-on: self-hosted
142+
runs-on: [self-hosted, nix]
143+
needs:
144+
- tests
145+
- doc
112146
steps:
113147
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
114-
- name: ✨ Generate coverage report
115-
run: just coverage-ci
148+
- name: ✨ Collect coverage reports
149+
run: nix build .#testCoverage
150+
- name: Move coverage files out of symlink
151+
run: mkdir -p coverage && cp result/*.lcov coverage && rm result
116152
- name: ✨ Publish to Coveralls
117-
uses: coverallsapp/github-action@master
153+
uses: coverallsapp/github-action@v2.3.6
118154
with:
119155
github-token: ${{ secrets.GITHUB_TOKEN }}
120156
# TODO: Kani
121157
feature-powerset:
122158
name: 🔌 Test feature powerset
123-
runs-on: self-hosted
159+
runs-on: [self-hosted, nix]
160+
needs:
161+
- dev-deps
124162
if: contains(github.event.pull_request.labels.*.name, 'heavy-tests')
125163
steps:
126164
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
127165
- name: ✨ Run feature powerset checks
128-
run: just feature-powerset-ci
166+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').featurePowerset"
129167
cadical-each-feature:
130168
name: 🧪 CaDiCaL test each feature
131-
runs-on: self-hosted
169+
runs-on: [self-hosted, nix]
170+
needs:
171+
- dev-deps
132172
if: contains(github.event.pull_request.labels.*.name, 'solvers/cadical')
133173
steps:
134174
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
135175
- name: 🧪 Test each feature
136-
run: just cadical-each-feature-ci
176+
run: nix develop ".#ci" --command cargo hack --each-feature --exclude-features logging nextest run -p rustsat-cadical
137177
kissat-each-feature:
138178
name: 🧪 Kissat test each feature
139-
runs-on: self-hosted
179+
runs-on: [self-hosted, nix]
180+
needs:
181+
- dev-deps
140182
if: contains(github.event.pull_request.labels.*.name, 'solvers/kissat')
141183
steps:
142184
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
143185
- name: 🧪 Test each feature
144-
run: just kissat-each-feature-ci
186+
run: nix develop ".#ci" --command cargo hack --each-feature nextest run -p rustsat-kissat
145187
cadical-valgrind:
146188
name: 🤖 CaDiCaL Valgrind
147-
runs-on: self-hosted
189+
runs-on: [self-hosted, nix]
190+
needs:
191+
- dev-deps
148192
if: contains(github.event.pull_request.labels.*.name, 'solvers/cadical')
149193
steps:
150194
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
151195
- name: 🧪 Tests through valgrind
152-
run: just cadical-valgrind-ci
196+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').cadicalValgrind"
153197
kissat-valgrind:
154198
name: 🤖 Kissat Valgrind
155-
runs-on: self-hosted
199+
runs-on: [self-hosted, nix]
200+
needs:
201+
- dev-deps
156202
if: contains(github.event.pull_request.labels.*.name, 'solvers/kissat')
157203
steps:
158204
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
159205
- name: 🧪 Tests through valgrind
160-
run: just kissat-valgrind-ci
206+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').kissatValgrind"
161207
minisat-valgrind:
162208
name: 🤖 Minisat Valgrind
163-
runs-on: self-hosted
209+
runs-on: [self-hosted, nix]
210+
needs:
211+
- dev-deps
164212
if: contains(github.event.pull_request.labels.*.name, 'solvers/minisat')
165213
steps:
166214
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
167215
- name: 🧪 Tests through valgrind
168-
run: just minisat-valgrind-ci
216+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').minisatValgrind"
169217
glucose-valgrind:
170218
name: 🤖 Glucose Valgrind
171-
runs-on: self-hosted
219+
runs-on: [self-hosted, nix]
220+
needs:
221+
- dev-deps
172222
if: contains(github.event.pull_request.labels.*.name, 'solvers/glucose')
173223
steps:
174224
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
175225
- name: 🧪 Tests through valgrind
176-
run: just glucose-valgrind-ci
226+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').glucoseValgrind"
177227
capi-valgrind:
178228
name: 🤖 C-API Valgrind
179-
runs-on: self-hosted
229+
runs-on: [self-hosted, nix]
230+
needs:
231+
- dev-deps
180232
if: contains(github.event.pull_request.labels.*.name, 'c-api')
181233
steps:
182234
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
183235
- name: 🧪 Tests through valgrind
184-
run: just capi-valgrind-ci
236+
run: nix build ".#checks.$(nix eval --impure --expr 'builtins.currentSystem').capiValgrind"

.github/workflows/pages.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ concurrency:
1515
jobs:
1616
# Build job
1717
build:
18-
runs-on: self-hosted
18+
runs-on: [self-hosted, nix]
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2222
- name: 🏗️ Build pages
23-
run: just pages-ci
23+
run: nix build .#pages
2424
- name: ⬆️ Upload artifact
25-
# Automatically uploads an artifact from the './_site' directory by default
2625
uses: actions/upload-pages-artifact@v3
26+
with:
27+
path: result/
2728
# Deployment job
2829
deploy:
2930
environment:

.github/workflows/semver-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ env:
88
jobs:
99
all:
1010
name: 🛡️ Semver checks
11-
runs-on: self-hosted
11+
runs-on: [self-hosted, nix]
1212
steps:
1313
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1414
- name: 🛡️ Run semver checks
15-
run: just semver-checks-ci
15+
run: nix run nixpkgs#just semver-checks

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/target
2+
/target-ci
3+
4+
/result
25

36
**/*.o
47
**/*.out

flake.lock

Lines changed: 22 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)