mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-04 20:03:40 +00:00
GitHub Actions runners are not guaranteed to have the necessary CPU features in order for these tests to work. Uses a `--target x86_64-unknown-linux-gnu` directive when compiling so the `target_feature` flags don't apply to build scripts.
68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ '*' ]
|
|
pull_request:
|
|
branches: [ 'main', 'develop', 'release/2.0' ]
|
|
|
|
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 --features alloc
|
|
- run: cargo test --target ${{ matrix.target }}
|
|
- 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
|
|
|
|
build-simd:
|
|
name: Test simd backend (nightly)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
- env:
|
|
RUSTFLAGS: "-C target_feature=+avx2"
|
|
run: cargo build --target x86_64-unknown-linux-gnu --features simd_backend
|
|
- env:
|
|
RUSTFLAGS: "-C target_feature=+avx512ifma"
|
|
run: cargo build --target x86_64-unknown-linux-gnu --features simd_backend
|
|
|
|
msrv:
|
|
name: Current MSRV is 1.56.1
|
|
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.56.1
|
|
- run: cargo build
|
|
|
|
bench:
|
|
name: Check that benchmarks compile
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo build --benches --features batch
|