-
Notifications
You must be signed in to change notification settings - Fork 47
89 lines (66 loc) · 2.08 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
name: Rust
on:
push:
branches: [dev]
pull_request:
branches: [dev]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
build_and_test:
name: "Build and Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/[email protected]
- name: Cargo update
run: cargo update
- name: "Build"
run: cargo build
- name: "Test"
# Run all tests (bins, examples, lib, integration and docs)
# https://doc.rust-lang.org/cargo/commands/cargo-test.html#target-selection
run: cargo test
- name: "Check documentation"
# env:
# RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --workspace --lib --document-private-items --examples
miri:
if: ( ! github.event.pull_request.draft )
name: "Test with Miri"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: miri
- uses: Swatinem/[email protected]
- name: Cargo update
run: cargo update
- name: Test with Miri on x86_64
run: cargo miri test -p clmul -p matrix-transpose --target x86_64-unknown-linux-gnu
- name: Test with Miri on aarch64
run: cargo miri test -p clmul -p matrix-transpose --target aarch64-unknown-linux-gnu
rustfmt_and_clippy:
name: Rustfmt and Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Nightly with rustfmt and clippy
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt, clippy
- uses: Swatinem/[email protected]
- name: "Check formatting"
run: cargo +nightly fmt --check --all
- name: Run Clippy
run: cargo clippy --all-targets --all-features