6
6
- main
7
7
pull_request :
8
8
branches :
9
- - main
9
+ - ' * '
10
10
merge_group :
11
11
types : [checks_requested]
12
12
workflow_dispatch : {}
23
23
24
24
jobs :
25
25
# Check if changes were made to the relevant files.
26
- # Always returns true if running on the default branch, to ensure all changes are throughly checked.
26
+ # Always returns true if running on the default branch, to ensure all changes are thoroughly checked.
27
27
changes :
28
28
name : Check for changes
29
29
runs-on : ubuntu-latest
35
35
outputs :
36
36
rust : ${{ steps.filter.outputs.rust == 'true' || steps.override.outputs.out == 'true' }}
37
37
python : ${{ steps.filter.outputs.python == 'true' || steps.override.outputs.out == 'true' }}
38
+ llvm : ${{ steps.filter.outputs.llvm == 'true' || steps.override.outputs.out == 'true' }}
38
39
steps :
39
40
- uses : actions/checkout@v4
40
41
- name : Override label
91
92
- name : Install CapnProto
92
93
run : sudo apt-get install -y capnproto
93
94
- name : Build benchmarks with no features
94
- run : cargo bench --verbose --no-run --workspace --no-default-features
95
+ run : cargo bench --verbose --no-run --no-default-features
95
96
- name : Build benchmarks with all features
96
- run : cargo bench --verbose --no-run --workspace --all-features
97
+ run : cargo bench --verbose --no-run --all-features
97
98
98
99
# Run tests on Rust stable
99
100
tests-stable-no-features :
@@ -110,12 +111,13 @@ jobs:
110
111
toolchain : " stable"
111
112
- name : Configure default rust toolchain
112
113
run : rustup override set ${{steps.toolchain.outputs.name}}
114
+
113
115
- name : Install CapnProto
114
116
run : sudo apt-get install -y capnproto
115
117
- name : Build with no features
116
- run : cargo test --verbose --workspace --no-default-features --no-run
118
+ run : cargo test --verbose --no-default-features --no-run
117
119
- name : Tests with no features
118
- run : cargo test --verbose --workspace --no-default-features
120
+ run : cargo test --verbose --no-default-features
119
121
120
122
# Run tests on Rust stable
121
123
tests-stable-all-features :
@@ -132,12 +134,13 @@ jobs:
132
134
toolchain : " stable"
133
135
- name : Configure default rust toolchain
134
136
run : rustup override set ${{steps.toolchain.outputs.name}}
137
+
135
138
- name : Install CapnProto
136
139
run : sudo apt-get install -y capnproto
137
140
- name : Build with all features
138
- run : cargo test --verbose --workspace --all-features --no-run
141
+ run : cargo test --verbose --all-features --no-run
139
142
- name : Tests with all features
140
- run : cargo test --verbose --workspace --all-features
143
+ run : cargo test --verbose --all-features
141
144
- name : Build HUGR binary
142
145
run : cargo build -p hugr-cli
143
146
- name : Upload the binary to the artifacts
@@ -170,13 +173,13 @@ jobs:
170
173
- name : Install CapnProto
171
174
run : sudo apt-get install -y capnproto
172
175
- name : Build with no features
173
- run : cargo test --verbose --workspace --no-default-features --no-run
176
+ run : cargo test --verbose --no-default-features --no-run
174
177
- name : Tests with no features
175
- run : cargo test --verbose --workspace --no-default-features
178
+ run : cargo test --verbose --no-default-features
176
179
- name : Build with all features
177
- run : cargo test --verbose --workspace --all-features --no-run
180
+ run : cargo test --verbose --all-features --no-run
178
181
- name : Tests with all features
179
- run : cargo test --verbose --workspace --all-features
182
+ run : cargo test --verbose --all-features
180
183
181
184
# Ensure that serialized extensions match rust implementation
182
185
std-extensions :
@@ -225,8 +228,8 @@ jobs:
225
228
- name : Run tests with coverage instrumentation
226
229
run : |
227
230
cargo llvm-cov clean --workspace
228
- cargo llvm-cov --no-report --workspace --no-default-features --doctests
229
- cargo llvm-cov --no-report --workspace --all-features --doctests
231
+ cargo llvm-cov --no-report --no-default-features --doctests
232
+ cargo llvm-cov --no-report --all-features --doctests
230
233
- name : Generate coverage report
231
234
run : cargo llvm-cov --all-features report --codecov --output-path coverage.json
232
235
- name : Upload coverage to codecov.io
@@ -237,6 +240,39 @@ jobs:
237
240
flags : rust
238
241
token : ${{ secrets.CODECOV_TOKEN }}
239
242
243
+ tests-stable-llvm :
244
+ needs : changes
245
+ if : ${{ ( needs.changes.outputs.llvm == 'true' && github.event_name == 'push' ) || needs.changes.outputs.override == 'true' }}
246
+ runs-on : ubuntu-latest
247
+ name : tests hugr-llvm
248
+ strategy :
249
+ matrix :
250
+ llvm-version :
251
+ # different strings for install action and feature name
252
+ # adapted from https://github.com/TheDan64/inkwell/blob/master/.github/workflows/test.yml
253
+ - ["14.0", "14-0"]
254
+
255
+ steps :
256
+ - uses : actions/checkout@v4
257
+ -
uses :
mozilla-actions/[email protected]
258
+ - id : toolchain
259
+ uses : dtolnay/rust-toolchain@master
260
+ with :
261
+ toolchain : " stable"
262
+ - name : Configure default rust toolchain
263
+ run : rustup override set ${{steps.toolchain.outputs.name}}
264
+ - name : Install CapnProto
265
+ run : sudo apt-get install -y capnproto
266
+ - name : Install LLVM and Clang
267
+ uses : KyleMayes/install-llvm-action@v2
268
+ with :
269
+ version : ${{ matrix.llvm-version[0] }}
270
+ env : true
271
+ - name : Build
272
+ run : cargo test -p hugr-llvm --verbose --features llvm${{ matrix.llvm-version[1] }} --no-run
273
+ - name : Tests with no features
274
+ run : cargo test -p hugr-llvm --verbose --features llvm${{ matrix.llvm-version[1] }}
275
+
240
276
rs-semver-checks :
241
277
needs : [changes, check]
242
278
if : ${{ needs.changes.outputs.rust == 'true' && github.event_name == 'pull_request' }}
0 commit comments