-
Notifications
You must be signed in to change notification settings - Fork 20
175 lines (149 loc) · 5.55 KB
/
rust.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
name: Rust
env:
min_rust_version: "1.64.0"
on:
push:
branches:
- master
paths:
- '.github/workflows/rust.yml'
- 'src/**/*.rs'
- 'tests/**/*.rs'
- 'Cargo.toml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- '**'
paths:
- '.github/workflows/rust.yml'
- 'src/**/*.rs'
- 'tests/**/*'
- 'Cargo.toml'
jobs:
min-rust-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Unix
run: |
if rustup --version >/dev/null 2>&1; then
rustup install ${{ env.min_rust_version }}
rustup default ${{ env.min_rust_version }}
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${{ env.min_rust_version }}
echo ::add-path::$HOME/.cargo/bin
fi
- name: Rust version
run: |
cargo --version
rustc --version
- name: Check
run: |
cargo check --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
full-test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: Install Rust Unix
run: |
if rustup --version >/dev/null 2>&1; then
rustup update
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
#- name: Install Miri
# run: |
# rustup toolchain install nightly
# rustup +nightly component add miri
- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
- name: Rust version
run: |
cargo --version
rustc --version
- name: Check build
run: cargo check --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
- name: Test
run: cargo test --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
- name: Valgrind Test
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --leak-check=full --error-exitcode=1 --suppressions=valgrind.supp""
run: cargo test --release --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
- name: Valgrind Test(No SSE2)
env:
RUSTFLAGS: "-Ctarget-feature=-sse2"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --leak-check=full --error-exitcode=1 --suppressions=valgrind.supp""
run: cargo test --release --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
- name: Valgrind Test(AVX2)
env:
RUSTFLAGS: "-Ctarget-feature=+avx2"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind --leak-check=full --error-exitcode=1 --suppressions=valgrind.supp""
run: cargo test --release --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
#- name: Miri Test(No SSE2)
# env:
# RUSTFLAGS: "-Ctarget-feature=-sse2"
# run: |
# cargo +nightly miri test --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
# cargo +nightly miri test --release --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3
wasm-platform-test:
needs: [full-test, min-rust-check]
runs-on: ubuntu-latest
container: ghcr.io/webassembly/wasi-sdk
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: Install system packages
run: apt-get update && apt-get install -y curl xz-utils
- name: Install Rust Unix
run: |
if rustup --version >/dev/null 2>&1; then
rustup update
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- name: Install Wasi runtime
run: |
curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v17.0.1/wasmtime-v17.0.1-x86_64-linux.tar.xz > wasmtime.tar.xz
mkdir $HOME/wasmtime
tar -xf wasmtime.tar.xz -C $HOME/wasmtime --strip-components 1
echo "$HOME/wasmtime/" >> $GITHUB_PATH
cargo install cargo-wasi
- name: Test simd128
env:
RUSTFLAGS: "-Ctarget-feature=+simd128"
run: cargo wasi test --test assert_correctness --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 -- --nocapture
cross-platform-test:
needs: [full-test, min-rust-check]
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
strategy:
matrix:
target: [
"arm-unknown-linux-musleabi",
"i586-unknown-linux-musl",
"powerpc-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
#"mips-unknown-linux-musl",
#"mips64-unknown-linux-gnuabi64"
]
steps:
- uses: actions/checkout@v4
- name: Install Rust Unix
run: |
if rustup --version >/dev/null 2>&1; then
rustup update
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- name: Install Cross
run: |
curl -L https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz | tar xfz -
cp cross $HOME/.cargo/bin
- name: Test ${{ matrix.target }}
run: cross test --features xxh32,const_xxh32,xxh64,const_xxh64,xxh3,const_xxh3 --release --target ${{ matrix.target }}