mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
This action is located at: https://github.com/RustCrypto/actions/blob/master/cross-install/action.yml It's used across the RustCrypto project for installing `cross` in CI. Installation is performed by fetching a pinned binary release from: https://github.com/cross-rs/cross/releases/ This eliminates problems that might occur when using `cargo install` such as: https://github.com/dalek-cryptography/curve25519-dalek/actions/runs/3786735408/jobs/6437902657 It's also marginally faster.
155 lines
4.7 KiB
YAML
155 lines
4.7 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ '**' ]
|
|
pull_request:
|
|
branches: [ '**' ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: '-D warnings'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
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
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: rustup target add ${{ matrix.target }}
|
|
- run: ${{ matrix.deps }}
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc
|
|
- run: cargo test --target ${{ matrix.target }} --no-default-features --features zeroize
|
|
- run: cargo test --target ${{ matrix.target }}
|
|
- run: cargo test --target ${{ matrix.target }} --features serde
|
|
- env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"'
|
|
run: cargo test --target ${{ matrix.target }}
|
|
|
|
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
|
|
- run: cargo build --target thumbv7em-none-eabi --release --no-default-features
|
|
- run: cargo build --target thumbv7em-none-eabi --release
|
|
- run: cargo build --target thumbv7em-none-eabi --release --features serde
|
|
|
|
build-simd:
|
|
name: Build simd backend (nightly)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
# Build with AVX2 features, then with AVX512 features
|
|
- env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2'
|
|
run: cargo build --target x86_64-unknown-linux-gnu
|
|
- env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma'
|
|
run: cargo build --target x86_64-unknown-linux-gnu
|
|
|
|
cross:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# ARM32
|
|
- target: armv7-unknown-linux-gnueabihf
|
|
rust: stable
|
|
|
|
# ARM64
|
|
- target: aarch64-unknown-linux-gnu
|
|
rust: stable
|
|
|
|
# PPC32
|
|
- target: powerpc-unknown-linux-gnu
|
|
rust: stable
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: ${{ matrix.deps }}
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
targets: ${{ matrix.target }}
|
|
- uses: RustCrypto/actions/cross-install@master
|
|
- run: cross test --release --target ${{ matrix.target }}
|
|
|
|
nightly:
|
|
name: Test nightly compiler
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
- run: cargo test
|
|
|
|
clippy:
|
|
name: Check that clippy is happy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
components: clippy
|
|
- env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2'
|
|
run: cargo clippy --target x86_64-unknown-linux-gnu
|
|
- env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma'
|
|
run: cargo clippy --target x86_64-unknown-linux-gnu
|
|
|
|
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
|
|
|
|
msrv:
|
|
name: Current MSRV is 1.60.0
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- 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
|
|
- uses: dtolnay/rust-toolchain@1.60.0
|
|
- run: cargo build --no-default-features --features serde
|
|
|
|
bench:
|
|
name: Check that benchmarks compile
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Build u32 bench
|
|
env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_bits="32"'
|
|
run: cargo build --benches
|
|
- name: Build u64 bench
|
|
env:
|
|
RUSTFLAGS: '--cfg curve25519_dalek_bits="64"'
|
|
run: cargo build --benches
|
|
- name: Build default (host native) bench
|
|
run: cargo build --benches
|