-
Notifications
You must be signed in to change notification settings - Fork 40
174 lines (126 loc) · 4.05 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
on: push
name: Continuous integration
env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
jobs:
library:
strategy:
matrix:
platform:
- ubuntu-latest
rust:
- stable
- beta
- nightly
- 1.81.0 # MSRV
include:
- platform: macos-latest # This serves as our aarch64 / arm64 runner
rust: stable
- platform: windows-latest
rust: stable
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Unit Tests
run: cargo test --all-features
- name: Property Tests
run: cargo test -p comparison --all-features
miri:
runs-on: ubuntu-latest
env:
MIRIFLAGS: --cfg _internal_xxhash3_force_scalar
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: miri
- name: Unsafe Code
run: cargo miri test --all-features
- name: Big Endian Platform
run: cargo miri test --all-features --target s390x-unknown-linux-gnu
lints:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- run: cargo fmt --check --all
- run: cargo clippy --all --all-targets --all-features
- run: cargo doc --all-features
no-std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: thumbv6m-none-eabi
- run: >
cargo build
--no-default-features
--features=xxhash32,xxhash64,xxhash3_64
--target thumbv6m-none-eabi
features:
runs-on: ubuntu-latest
env:
IMPLEMENTATIONS: xxhash32 xxhash64 xxhash3_64
FEATURE_SET: random serialize std alloc
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Compute Powerset
shell: "ruby {0}"
run: |
features = ENV['FEATURE_SET']
.split(' ')
.reduce([[]]) { |ps, i| ps + ps.map { |e| e + [i] } }
.map { |s| s.join(',') }
.join(" ")
File.open(ENV['GITHUB_ENV'], 'a') { |f| f.write("FEATURES=#{features}") }
- name: Check implementations with features
run: |
for impl in ${IMPLEMENTATIONS}; do
echo "::group::Implementation ${impl}"
# Check the implementation by itself
cargo check --no-default-features --features="${impl}"
# And with extra features
for feature in ${FEATURES}; do
echo "::group::Features ${feature}"
cargo check --no-default-features --features="${impl},${feature}"
echo "::endgroup::"
done
echo ::endgroup::
done
minimal-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.81.0 # MSRV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Remove non-essential dependencies
run: |
# Remove workspace dependencies
sed -i '/\[workspace]/,/#END-\[workspace]/d' Cargo.toml
# Remove dev-dependencies
sed -i '/\[dev-dependencies]/,/#END-\[dev-dependencies]/d' Cargo.toml
- name: Downgrade to minimal dependencies
run: |
cargo +nightly -Z minimal-versions update
- run: cargo +1.81.0 build --all-features