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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
RUST_BACKTRACE: 1
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
rustfmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
- run: cargo fmt --all -- --check
- run: cargo fmt --manifest-path benchmark/Cargo.toml --all -- --check
check-warnings:
name: Check for build failures/warnings on ${{ matrix.target }} (rust ${{ matrix.rust }})
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
strategy:
fail-fast: false
matrix:
rust:
target:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
target: ${{ matrix.target }}
components: rust-src
- run: cargo check --all-targets --verbose --target=${{ matrix.target }}
- run: cargo check --all-targets --verbose --all-features --target=${{ matrix.target }}
- run: cargo check --manifest-path benchmark/Cargo.toml --all-targets --verbose --target=${{ matrix.target }}
test:
name: Test ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
rust:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- run: cargo test --verbose
- run: cargo test --verbose --all-features
test-cross:
name: Cross Test ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
# 32/64 bit arm
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
# 32bit x86 (with/without decent instructions)
- i686-unknown-linux-gnu
- i586-unknown-linux-gnu
# # 32bit big endian
# - mips-unknown-linux-gnu
# - mips64-unknown-linux-gnuabi64
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
target: ${{ matrix.target }}
components: rust-src
- uses: taiki-e/install-action@cross
- run: cross test --verbose --target=${{ matrix.target }}
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: miri, rust-src
# Note: Can't use strict miri flags til it gets more support for atomic
# ops on pointers
- run: cargo miri test
env:
MIRIFLAGS: -Zmiri-disable-isolation
# sanitizers:
# name: Test sanitizer ${{ matrix.sanitizer }}
# runs-on: ubuntu-latest
# env:
# RUST_BACKTRACE: 0
# # only used by asan, but we set it for all of them cuz its easy
# ASAN_OPTIONS: detect_stack_use_after_return=1
# strategy:
# fail-fast: false
# matrix:
# sanitizer: [address, memory, thread]
# include:
# - sanitizer: memory
# extra_rustflags: "-Zsanitizer-memory-track-origins"
#
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 1
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: nightly
# override: true
# components: rust-src
# - name: Test with sanitizer
# env:
# RUSTFLAGS: -Zsanitizer=${{ matrix.sanitizer }} ${{ matrix.extra_rustflags }}
# RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer }} ${{ matrix.extra_rustflags }}
# run: |
# echo "note: RUSTFLAGS='$RUSTFLAGS'"
# cargo -Zbuild-std test --target=x86_64-unknown-linux-gnu