|
8 | 8 |
|
9 | 9 | env:
|
10 | 10 | CARGO_TERM_COLOR: always
|
| 11 | + RUSTFLAGS: '-D warnings' |
| 12 | + RUSTDOCFLAGS: '-D warnings' |
11 | 13 |
|
12 | 14 | jobs:
|
13 |
| - test-u32: |
14 |
| - name: Test u32 backend |
| 15 | + test: |
| 16 | + name: Test all features |
15 | 17 | runs-on: ubuntu-latest
|
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + include: |
| 21 | + # 32-bit target |
| 22 | + - target: i686-unknown-linux-gnu |
| 23 | + deps: sudo apt update && sudo apt install gcc-multilib |
| 24 | + # 64-bit target |
| 25 | + - target: x86_64-unknown-linux-gnu |
16 | 26 | steps:
|
17 |
| - - uses: actions/checkout@v2 |
18 |
| - - uses: actions-rs/toolchain@v1 |
19 |
| - with: |
20 |
| - profile: minimal |
21 |
| - toolchain: stable |
22 |
| - override: true |
23 |
| - - uses: actions-rs/cargo@v1 |
24 |
| - with: |
25 |
| - command: test |
26 |
| - args: --no-default-features --features "std u32_backend" |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + - uses: dtolnay/rust-toolchain@stable |
| 29 | + with: |
| 30 | + target: ${{ matrix.target }} |
| 31 | + - run: ${{ matrix.deps }} |
| 32 | + - run: cargo test --target ${{ matrix.target }} --all-features |
27 | 33 |
|
28 |
| - test-u64: |
29 |
| - name: Test u64 backend |
| 34 | + build-simd: |
| 35 | + name: Test simd backend (nightly) |
30 | 36 | runs-on: ubuntu-latest
|
31 | 37 | steps:
|
32 |
| - - uses: actions/checkout@v2 |
33 |
| - - uses: actions-rs/toolchain@v1 |
34 |
| - with: |
35 |
| - profile: minimal |
36 |
| - toolchain: stable |
37 |
| - override: true |
38 |
| - - uses: actions-rs/cargo@v1 |
39 |
| - with: |
40 |
| - command: test |
41 |
| - args: --no-default-features --features "std u64_backend" |
| 38 | + - uses: actions/checkout@v3 |
| 39 | + - uses: dtolnay/rust-toolchain@nightly |
| 40 | + - env: |
| 41 | + RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2' |
| 42 | + run: cargo build --target x86_64-unknown-linux-gnu |
| 43 | + - env: |
| 44 | + RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma' |
| 45 | + run: cargo build --target x86_64-unknown-linux-gnu |
42 | 46 |
|
43 |
| - nightly: |
44 |
| - name: Test nightly compiler |
| 47 | + msrv: |
| 48 | + name: Current MSRV is 1.60.0 |
45 | 49 | runs-on: ubuntu-latest
|
46 | 50 | steps:
|
47 |
| - - uses: actions/checkout@v2 |
48 |
| - - uses: actions-rs/toolchain@v1 |
49 |
| - with: |
50 |
| - profile: minimal |
51 |
| - toolchain: nightly |
52 |
| - override: true |
53 |
| - - uses: actions-rs/cargo@v1 |
54 |
| - with: |
55 |
| - command: test |
56 |
| - args: --features "nightly" |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + # First delete the checked-in `Cargo.lock`. We're going to regenerate it |
| 53 | + - run: rm Cargo.lock |
| 54 | + # Now run `cargo +nightly -Z minimal-verisons check` in order to get a |
| 55 | + # Cargo.lock with the oldest possible deps |
| 56 | + - uses: dtolnay/rust-toolchain@nightly |
| 57 | + - run: cargo -Z minimal-versions check --no-default-features --features serde |
| 58 | + # Now check that `cargo build` works with respect to the oldest possible |
| 59 | + # deps and the stated MSRV |
| 60 | + - uses: dtolnay/rust-toolchain@1.60.0 |
| 61 | + - run: cargo build |
| 62 | + |
| 63 | +# no_std support is pending feature, tracking: |
| 64 | +# https://github.com/dalek-cryptography/x25519-dalek/issues/111 |
| 65 | +# # Test no_std integration with no features |
| 66 | +# build-nostd-base: |
| 67 | +# name: Build on no_std target (thumbv7em-none-eabi) |
| 68 | +# runs-on: ubuntu-latest |
| 69 | +# steps: |
| 70 | +# - uses: actions/checkout@v3 |
| 71 | +# - uses: dtolnay/rust-toolchain@master |
| 72 | +# with: |
| 73 | +# toolchain: stable |
| 74 | +# targets: thumbv7em-none-eabi |
| 75 | +# - uses: taiki-e/install-action@cargo-hack |
| 76 | +# # No default features build |
| 77 | +# - run: cargo build --target thumbv7em-none-eabi --release --no-default-features |
| 78 | +# |
| 79 | +# # Test no_std integration with all no_std features |
| 80 | +# build-nostd-features: |
| 81 | +# name: Build on no_std target (thumbv7em-none-eabi) |
| 82 | +# runs-on: ubuntu-latest |
| 83 | +# steps: |
| 84 | +# - uses: actions/checkout@v3 |
| 85 | +# - uses: dtolnay/rust-toolchain@master |
| 86 | +# with: |
| 87 | +# toolchain: stable |
| 88 | +# targets: thumbv7em-none-eabi |
| 89 | +# - uses: taiki-e/install-action@cargo-hack |
| 90 | +# # No default features build |
| 91 | +# - run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std |
57 | 92 |
|
58 |
| - test-defaults-serde: |
59 |
| - name: Test default feature selection and serde |
| 93 | + bench: |
| 94 | + name: Check that benchmarks compile |
60 | 95 | runs-on: ubuntu-latest
|
61 | 96 | steps:
|
62 |
| - - uses: actions/checkout@v2 |
63 |
| - - uses: actions-rs/toolchain@v1 |
64 |
| - with: |
65 |
| - profile: minimal |
66 |
| - toolchain: stable |
67 |
| - override: true |
68 |
| - - uses: actions-rs/cargo@v1 |
69 |
| - with: |
70 |
| - command: test |
71 |
| - args: --features "serde" |
| 97 | + - uses: actions/checkout@v3 |
| 98 | + - uses: dtolnay/rust-toolchain@stable |
| 99 | + - run: cargo build --benches |
72 | 100 |
|
73 |
| - msrv: |
74 |
| - name: Current MSRV is 1.51 |
| 101 | + rustfmt: |
| 102 | + name: Check formatting |
75 | 103 | runs-on: ubuntu-latest
|
76 | 104 | steps:
|
77 |
| - - uses: actions/checkout@v2 |
78 |
| - - uses: actions-rs/toolchain@v1 |
79 |
| - with: |
80 |
| - profile: minimal |
81 |
| - toolchain: 1.51 |
82 |
| - override: true |
83 |
| - - uses: actions-rs/cargo@v1 |
84 |
| - with: |
85 |
| - command: build |
| 105 | + - uses: actions/checkout@v3 |
| 106 | + - uses: dtolnay/rust-toolchain@stable |
| 107 | + with: |
| 108 | + components: rustfmt |
| 109 | + - run: cargo fmt --all -- --check |
86 | 110 |
|
87 |
| - bench: |
88 |
| - name: Check that benchmarks compile |
| 111 | + clippy: |
| 112 | + name: Check that clippy is happy |
| 113 | + runs-on: ubuntu-latest |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v3 |
| 116 | + - uses: dtolnay/rust-toolchain@1.65 |
| 117 | + with: |
| 118 | + components: clippy |
| 119 | + - run: cargo clippy |
| 120 | + |
| 121 | + doc: |
89 | 122 | runs-on: ubuntu-latest
|
90 | 123 | steps:
|
91 |
| - - uses: actions/checkout@v2 |
92 |
| - - uses: actions-rs/toolchain@v1 |
93 |
| - with: |
94 |
| - profile: minimal |
95 |
| - toolchain: stable |
96 |
| - override: true |
97 |
| - - uses: actions-rs/cargo@v1 |
98 |
| - with: |
99 |
| - command: bench |
100 |
| - # This filter selects no benchmarks, so we don't run any, only build them. |
101 |
| - args: "DONTRUNBENCHMARKS" |
| 124 | + - uses: actions/checkout@v3 |
| 125 | + - uses: dtolnay/rust-toolchain@stable |
| 126 | + with: |
| 127 | + toolchain: stable |
| 128 | + - run: cargo doc --all-features |
0 commit comments