2021-09-14 00:45:42 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ '*' ]
|
|
|
|
pull_request:
|
2022-11-20 13:08:05 -07:00
|
|
|
branches: [ 'main', 'develop', 'release/2.0' ]
|
2021-09-14 00:45:42 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2022-11-20 20:28:09 -07:00
|
|
|
RUSTFLAGS: '-D warnings'
|
2021-09-14 00:45:42 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-11-20 13:08:05 -07:00
|
|
|
test:
|
2021-09-14 00:45:42 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-11-20 13:08:05 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# 32-bit target
|
|
|
|
- target: i686-unknown-linux-gnu
|
|
|
|
deps: sudo apt update && sudo apt install gcc-multilib
|
|
|
|
# 64-bit target
|
|
|
|
- target: x86_64-unknown-linux-gnu
|
2021-09-14 00:45:42 +00:00
|
|
|
steps:
|
2022-11-20 13:08:05 -07:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- run: rustup target add ${{ matrix.target }}
|
|
|
|
- run: ${{ matrix.deps }}
|
2022-11-21 15:23:05 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc
|
2022-11-20 13:08:05 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }}
|
2022-11-21 15:23:05 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --features batch
|
|
|
|
- run: cargo test --target ${{ matrix.target }} --features batch_deterministic
|
|
|
|
- run: cargo test --target ${{ matrix.target }} --features serde
|
2022-12-13 16:19:31 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --features pkcs8
|
2021-09-14 00:45:42 +00:00
|
|
|
|
2022-12-07 01:07:55 -07:00
|
|
|
build-simd:
|
2021-09-14 00:45:42 +00:00
|
|
|
name: Test simd backend (nightly)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-21 15:23:05 -07:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: dtolnay/rust-toolchain@nightly
|
2022-12-07 01:07:55 -07:00
|
|
|
- env:
|
2022-12-09 19:14:38 -07:00
|
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2'
|
|
|
|
run: cargo build --target x86_64-unknown-linux-gnu
|
2022-12-07 01:07:55 -07:00
|
|
|
- env:
|
2022-12-09 19:14:38 -07:00
|
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma'
|
|
|
|
run: cargo build --target x86_64-unknown-linux-gnu
|
2021-09-14 00:45:42 +00:00
|
|
|
|
|
|
|
msrv:
|
2022-12-13 16:19:31 -07:00
|
|
|
name: Current MSRV is 1.57.0
|
2021-09-14 00:45:42 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-21 15:23:05 -07:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
# First run `cargo +nightly -Z minimal-verisons check` in order to get a
|
|
|
|
# Cargo.lock with the oldest possible deps
|
|
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
|
|
- run: cargo -Z minimal-versions check --no-default-features --features serde
|
|
|
|
# Now check that `cargo build` works with respect to the oldest possible
|
|
|
|
# deps and the stated MSRV
|
2022-12-13 16:19:31 -07:00
|
|
|
- uses: dtolnay/rust-toolchain@1.57.0
|
2022-11-21 15:23:05 -07:00
|
|
|
- run: cargo build
|
2021-09-14 00:45:42 +00:00
|
|
|
|
|
|
|
bench:
|
|
|
|
name: Check that benchmarks compile
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-21 15:23:05 -07:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- run: cargo build --benches --features batch
|
2022-12-19 07:56:41 +11:00
|
|
|
|
2022-12-20 02:37:04 -07:00
|
|
|
rustfmt:
|
|
|
|
name: Check formatting
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
components: rustfmt
|
|
|
|
- run: cargo fmt --all -- --check
|
|
|
|
|
2022-12-19 07:56:41 +11:00
|
|
|
clippy:
|
|
|
|
name: Check that clippy is happy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@1.65
|
|
|
|
with:
|
|
|
|
components: clippy
|
2022-12-20 02:37:04 -07:00
|
|
|
- run: cargo clippy
|