1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-04 02:36:08 +02:00
BLAKE3/.github/workflows/ci.yml
Jack O'Connor e06a0f255a refactor the Cargo feature set
The biggest change here is that assembly implementations are enabled by
default.

Added features:
- "pure" (Pure Rust, with no C or assembly implementations.)

Removed features:
- "c" (Now basically the default.)

Renamed features;
- "c_prefer_intrinsics" -> "prefer_intrinsics"
- "c_neon" -> "neon"

Unchanged:
- "rayon"
- "std" (Still the only feature on by default.)
2020-03-29 18:02:03 -04:00

138 lines
4.8 KiB
YAML

name: tests
on: [push, pull_request]
jobs:
cargo_tests:
name: ${{ matrix.target.name }} ${{ matrix.channel }}
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target: [
{ "os": "ubuntu-latest", "toolchain": "x86_64-unknown-linux-gnu", "name": "Linux GNU" },
{ "os": "macOS-latest", "toolchain": "x86_64-apple-darwin", "name": "macOS" },
{ "os": "windows-latest", "toolchain": "x86_64-pc-windows-msvc", "name": "Windows MSVC" },
{ "os": "windows-latest", "toolchain": "x86_64-pc-windows-gnu", "name": "Windows GNU" }
]
channel: [stable, beta, nightly]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ format('{0}-{1}', matrix.channel, matrix.target.toolchain) }}
profile: minimal
override: true
# Print out instruction set support, for debugging.
- run: cargo run --quiet --bin instruction_set_support
# Default tests plus Rayon.
- run: cargo test --features=rayon
# no_std tests.
- run: cargo test --no-default-features
# Test the intrinsics implementations.
- run: cargo test --features=prefer_intrinsics
# Test the pure Rust build.
- run: cargo test --features=pure
# Test release mode. This does more iteratations in test_fuzz_hasher.
- run: cargo test --release
- run: cargo test --release --features=prefer_intrinsics
- run: cargo test --release --features=pure
# Test benchmarks. RUSTC_BOOTSTRAP=1 lets this run on non-nightly toolchains.
- run: cargo test --benches
env:
RUSTC_BOOTSTRAP: 1
# Test vectors.
- name: test vectors
run: cargo test
working-directory: ./test_vectors
- name: test vectors intrinsics
run: cargo test --features=prefer_intrinsics
working-directory: ./test_vectors
- name: test vectors pure
run: cargo test --features=pure
working-directory: ./test_vectors
# Test b3sum.
- name: test b3sum
run: cargo test
working-directory: ./b3sum
- name: test b3sum --no-default-features
run: cargo test --no-default-features
working-directory: ./b3sum
# Test C code.
- name: cargo test C bindings assembly
run: cargo test
working-directory: ./c/blake3_c_rust_bindings
- name: cargo test C bindings intrinsics
run: cargo test --features=prefer_intrinsics
working-directory: ./c/blake3_c_rust_bindings
# Reference impl doc test.
- name: reference impl doc test
run: cargo test
working-directory: ./reference_impl
cross_tests:
name: cross ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- i686-unknown-linux-musl
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- mips-unknown-linux-gnu
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo install cross
# Test the portable implementation on everything.
- run: cross test --target ${{ matrix.arch }}
# Test the NEON implementation on ARM targets.
- run: cross test --target ${{ matrix.arch }} --features=neon
if: startsWith(matrix.arch, 'armv7-') || startsWith(matrix.arch, 'aarch64-')
# Test vectors. Note that this uses a hacky script due to path dependency limitations.
- run: ./test_vectors/cross_test.sh --target ${{ matrix.arch }}
# Currently only on x86.
c_tests:
name: C Makefile tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Test the intrinsics-based implementations.
- run: make test
working-directory: ./c
- run: make clean && rm blake3_sse41.c
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 make test
working-directory: ./c
- run: make clean && rm blake3_avx2.c
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 make test
working-directory: ./c
- run: make clean && rm blake3_avx512.c
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make test
working-directory: ./c
# Test the assembly implementations.
- run: make test_asm
working-directory: ./c
- run: make clean && rm blake3_sse41_x86-64_unix.S
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 make test_asm
working-directory: ./c
- run: make clean && rm blake3_avx2_x86-64_unix.S
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 make test_asm
working-directory: ./c
- run: make clean && rm blake3_avx512_x86-64_unix.S
working-directory: ./c
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make test_asm
working-directory: ./c