-
Notifications
You must be signed in to change notification settings - Fork 3
205 lines (172 loc) · 6.03 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: CI
on:
pull_request:
push:
branches:
- main
schedule:
# Force a run every day at 0007 UTC
- cron: '00 07 * * *'
env:
CI: '1'
CARGO_TERM_COLOR: 'always'
# Emit backtraces on panics (though these may be worthless without debug info).
RUST_BACKTRACE: '1'
# Disable incremental builds; see https://matklad.github.io/2021/09/04/fast-rust-builds.html:
#
# CI builds often are closer to from-scratch builds, as changes are typically much bigger than from a local edit-compile cycle.
# For from-scratch builds, incremental adds an extra dependency-tracking overhead.
# It also significantly increases the amount of IO and the size of ./target, which make caching less effective.
CARGO_INCREMENTAL: '0'
# Disable debug info in CI; speeds up builds and shrinks Actions caches a bit
CARGO_PROFILE_RELEASE_DEBUG: '0'
CARGO_PROFILE_DEV_DEBUG: '0'
CARGO_PROFILE_TEST_DEBUG: '0'
# Enable Cargo output explaining why things are being rebuilt.
# This can be useful to investigate why caching is not working as expected.
#
# https://stackoverflow.com/a/70174212
# https://doc.crates.io/contrib/implementation/debugging.html#logging
# CARGO_LOG: 'cargo::core::compiler::fingerprint=info'
jobs:
tests:
name: CI (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: ubuntu-20.04.x86_64.release
os: ubuntu-20.04
rust: stable
profile: release
features: unit_hyperscan
install_dependencies: |
sudo apt-get install zsh libboost-all-dev
check_docs: false
- name: ubuntu-22.04.x86_64.test
os: ubuntu-22.04
rust: stable
profile: test
features: unit_hyperscan
install_dependencies: |
sudo apt-get install zsh libboost-all-dev
check_docs: true
- name: ubuntu-22.04.x86_64.release.cpu_native
os: ubuntu-22.04
rust: stable
profile: release
features: unit_hyperscan,cpu_native
install_dependencies: |
sudo apt-get install zsh libboost-all-dev
check_docs: false
- name: ubuntu-24.04.x86_64.test
os: ubuntu-24.04
rust: stable
profile: test
features: unit_hyperscan
install_dependencies: |
sudo apt-get install zsh libboost-all-dev
check_docs: true
- name: macos-13.x86_64.test
os: macos-13
rust: stable
profile: test
features: unit_hyperscan
install_dependencies: |
brew install coreutils boost
check_docs: false
- name: macos-13.x86_64.release
os: macos-13
rust: stable
profile: release
features: unit_hyperscan
install_dependencies: |
brew install coreutils boost
check_docs: false
# Fails with `unknown target CPU 'x86_64_v2'`:
#
# - name: macos-13.x86_64.release.cpu_native
# os: macos-13
# rust: stable
# profile: release
# features: unit_hyperscan,cpu_native
# install_dependencies: |
# brew install coreutils boost
# check_docs: false
- name: macos-14.arm64.test
os: macos-14 # m1-based macos
rust: stable
profile: test
features: unit_hyperscan
install_dependencies: |
brew install coreutils boost
check_docs: false
- name: macos-14.arm64.release
os: macos-14 # m1-based macos
rust: stable
profile: release
features: unit_hyperscan
install_dependencies: |
brew install coreutils boost
check_docs: false
# A build that runs with `bindgen` enabled
- name: macos-14.arm64.gen.release
os: macos-14 # m1-based macos
rust: stable
profile: release
features: unit_hyperscan,gen
install_dependencies: |
brew install coreutils boost
check_docs: false
- name: macos-14.arm64.release.cpu_native
os: macos-14 # m1-based macos
rust: stable
profile: release
features: unit_hyperscan,cpu_native
install_dependencies: |
brew install coreutils boost
check_docs: false
# Fails:
#
# - name: windows-2022.x86_64.test
# os: windows-2022
# rust: stable
# profile: test
# features: unit_hyperscan
# install_dependencies: |
# check_docs: false
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install dependencies
run: ${{ matrix.install_dependencies }}
- name: Install Rust toolchain
id: install-rust-toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
# N.B. cache disabled since certain build configurations end up producing
# microarchitecture-specific code that is not portable across CPUs
# generally
# - name: Cache
# uses: Swatinem/rust-cache@v2
# with:
# prefix-key: 'ci-tests'
# key: ${{ matrix.name }}
- name: Build tests
run: cargo test --no-run -vv --profile=${{ matrix.profile }} --features=${{ matrix.features }} --timings
- name: Run tests
run: cargo test -vv --profile=${{ matrix.profile }} --features=${{ matrix.features }} --timings
- name: Check documentation
if: ${{ matrix.check_docs }}
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --verbose --profile=${{ matrix.profile }} --features=${{ matrix.features }} --timings --no-deps --document-private-items
# See https://doc.rust-lang.org/nightly/cargo/reference/timings.html for details
- name: Upload build timings
uses: actions/upload-artifact@v4
with:
name: build-timings.${{ matrix.name }}
path: target/cargo-timings
if-no-files-found: error