2021-09-14 00:45:42 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-01-02 00:59:19 -05:00
|
|
|
branches: [ '**' ]
|
2021-09-14 00:45:42 +00:00
|
|
|
pull_request:
|
2023-01-02 00:59:19 -05:00
|
|
|
branches: [ '**' ]
|
2021-09-14 00:45:42 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2022-11-20 20:28:09 -07:00
|
|
|
RUSTFLAGS: '-D warnings'
|
2023-01-20 22:21:35 -07:00
|
|
|
RUSTDOCFLAGS: '-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 }}
|
2023-01-20 13:46:17 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --lib --tests
|
2022-12-20 02:48:55 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc --lib
|
2023-01-20 13:46:17 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features fast --lib
|
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features rand_core --lib --tests
|
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc,rand_core --lib --tests
|
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features fast,rand_core --lib --tests
|
|
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc,fast,rand_core --lib --tests
|
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
|
2023-01-20 13:46:17 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --features digest,rand_core
|
2022-11-21 15:23:05 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --features serde
|
2023-01-02 00:59:19 -05:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --features pem
|
2023-01-20 13:46:17 -07:00
|
|
|
- run: cargo test --target ${{ matrix.target }} --all-features
|
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:
|
2023-03-07 08:44:55 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-11-21 15:23:05 -07:00
|
|
|
- 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-20 02:48:55 -07:00
|
|
|
name: Current MSRV is 1.60.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
|
2023-02-04 03:24:09 -05:00
|
|
|
# First delete the checked-in `Cargo.lock`. We're going to regenerate it
|
|
|
|
- run: rm Cargo.lock
|
|
|
|
# Now run `cargo +nightly -Z minimal-verisons check` in order to get a
|
2022-11-21 15:23:05 -07:00
|
|
|
# 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-20 02:48:55 -07:00
|
|
|
- uses: dtolnay/rust-toolchain@1.60.0
|
2022-11-21 15:23:05 -07:00
|
|
|
- run: cargo build
|
2021-09-14 00:45:42 +00:00
|
|
|
|
2023-03-21 16:46:43 +11:00
|
|
|
build-nostd:
|
|
|
|
name: Build on no_std target (thumbv7em-none-eabi)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@master
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
targets: thumbv7em-none-eabi
|
|
|
|
- uses: taiki-e/install-action@cargo-hack
|
|
|
|
# No default features build
|
|
|
|
- run: cargo build --target thumbv7em-none-eabi --release --no-default-features
|
|
|
|
# TODO: serde pending PR#288
|
|
|
|
- run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std,serde
|
|
|
|
|
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
|
2023-01-02 00:59:19 -05:00
|
|
|
- run: cargo clippy
|
2023-01-20 22:21:35 -07:00
|
|
|
|
|
|
|
doc:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- run: cargo doc --all-features
|