2019-12-10 03:20:04 +01:00
|
|
|
name: tests
|
|
|
|
|
2020-01-10 16:22:12 +01:00
|
|
|
on: [push, pull_request]
|
2019-12-10 03:20:04 +01:00
|
|
|
|
|
|
|
jobs:
|
2019-12-10 03:25:24 +01:00
|
|
|
cargo_tests:
|
2020-02-07 19:46:42 +01:00
|
|
|
name: ${{ matrix.target.name }} ${{ matrix.channel }}
|
|
|
|
runs-on: ${{ matrix.target.os }}
|
2019-12-10 03:20:04 +01:00
|
|
|
strategy:
|
2020-02-07 00:43:50 +01:00
|
|
|
fail-fast: false
|
2019-12-10 03:20:04 +01:00
|
|
|
matrix:
|
2020-02-07 19:46:42 +01:00
|
|
|
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]
|
2019-12-10 03:20:04 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2020-02-07 19:46:42 +01:00
|
|
|
toolchain: ${{ format('{0}-{1}', matrix.channel, matrix.target.toolchain) }}
|
|
|
|
profile: minimal
|
2019-12-10 03:20:04 +01:00
|
|
|
override: true
|
2020-02-11 20:13:30 +01:00
|
|
|
# Default tests plus Rayon.
|
|
|
|
- run: cargo test --features=rayon
|
|
|
|
# no_std tests.
|
2019-12-10 03:20:04 +01:00
|
|
|
- run: cargo test --no-default-features
|
2020-02-11 20:13:30 +01:00
|
|
|
# Test the x86 assembly implementations. Use -vv to log compiler commands.
|
|
|
|
- run: cargo test --features=c -vv
|
|
|
|
# Test the C intrinsics implementations. Use -vv to log compiler commands.
|
|
|
|
- run: cargo test --features=c,c_prefer_intrinsics -vv
|
2019-12-13 19:15:48 +01:00
|
|
|
# Test release mode. This does more iteratations in test_fuzz_hasher.
|
|
|
|
- run: cargo test --release
|
2020-02-11 20:13:30 +01:00
|
|
|
# Test benchmarks. RUSTC_BOOTSTRAP=1 lets this run on non-nightly toolchains.
|
|
|
|
- run: cargo test --benches --features=c
|
|
|
|
env:
|
|
|
|
RUSTC_BOOTSTRAP: 1
|
2019-12-12 05:19:34 +01:00
|
|
|
# Test vectors.
|
|
|
|
- name: test vectors
|
|
|
|
run: cargo test
|
|
|
|
working-directory: ./test_vectors
|
2020-02-12 00:37:23 +01:00
|
|
|
- name: test vectors C assembly
|
2020-02-11 20:13:30 +01:00
|
|
|
run: cargo test --features=c
|
|
|
|
working-directory: ./test_vectors
|
2020-02-12 00:37:23 +01:00
|
|
|
- name: test vectors C intrinsics
|
2020-02-11 20:13:30 +01:00
|
|
|
run: cargo test --features=c,c_prefer_intrinsics
|
|
|
|
working-directory: ./test_vectors
|
2019-12-12 08:13:16 +01:00
|
|
|
# Test b3sum.
|
|
|
|
- name: test b3sum
|
|
|
|
run: cargo test
|
|
|
|
working-directory: ./b3sum
|
2019-12-12 20:40:56 +01:00
|
|
|
- name: test b3sum --no-default-features
|
|
|
|
run: cargo test --no-default-features
|
|
|
|
working-directory: ./b3sum
|
2020-01-14 00:11:07 +01:00
|
|
|
# Test C code.
|
2020-02-12 00:37:23 +01:00
|
|
|
- name: cargo test C bindings assembly
|
2020-01-14 00:11:07 +01:00
|
|
|
run: cargo test
|
|
|
|
working-directory: ./c/blake3_c_rust_bindings
|
2020-02-12 00:37:23 +01:00
|
|
|
- name: cargo test C bindings intrinsics
|
|
|
|
run: cargo test --features=prefer_intrinsics
|
|
|
|
working-directory: ./c/blake3_c_rust_bindings
|
2020-01-20 22:36:30 +01:00
|
|
|
# Reference impl doc test.
|
|
|
|
- name: reference impl doc test
|
|
|
|
run: cargo test
|
|
|
|
working-directory: ./reference_impl
|
2019-12-10 03:20:04 +01:00
|
|
|
|
2019-12-10 03:25:24 +01:00
|
|
|
cross_tests:
|
2019-12-12 05:19:34 +01:00
|
|
|
name: cross ${{ matrix.arch }}
|
2019-12-10 03:20:04 +01:00
|
|
|
runs-on: ubuntu-latest
|
2019-12-12 05:19:34 +01:00
|
|
|
strategy:
|
2020-03-24 21:45:33 +01:00
|
|
|
fail-fast: false
|
2019-12-12 05:19:34 +01:00
|
|
|
matrix:
|
2020-02-11 19:58:26 +01:00
|
|
|
arch:
|
|
|
|
- i686-unknown-linux-musl
|
|
|
|
- armv7-unknown-linux-gnueabihf
|
|
|
|
- aarch64-unknown-linux-gnu
|
|
|
|
- mips-unknown-linux-gnu
|
2019-12-10 03:20:04 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- run: cargo install cross
|
2019-12-12 05:19:34 +01:00
|
|
|
# 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=c_neon
|
2019-12-12 05:21:25 +01:00
|
|
|
if: startsWith(matrix.arch, 'armv7-') || startsWith(matrix.arch, 'aarch64-')
|
2019-12-12 05:19:34 +01:00
|
|
|
# Test vectors. Note that this uses a hacky script due to path dependency limitations.
|
|
|
|
- run: ./test_vectors/cross_test.sh --target ${{ matrix.arch }}
|
2020-01-09 05:10:32 +01:00
|
|
|
|
|
|
|
# Currently only on x86.
|
|
|
|
c_tests:
|
2020-01-14 00:11:07 +01:00
|
|
|
name: C Makefile tests
|
2020-01-09 05:10:32 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2020-02-12 19:10:24 +01:00
|
|
|
# Test the intrinsics-based implementations.
|
2020-01-09 05:10:32 +01:00
|
|
|
- run: make test
|
|
|
|
working-directory: ./c
|
2020-01-20 22:19:16 +01:00
|
|
|
- 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
|
2020-02-12 19:10:24 +01:00
|
|
|
# Test the assembly implementations.
|
|
|
|
- run: make test_asm
|
|
|
|
working-directory: ./c
|
2020-02-13 00:23:36 +01:00
|
|
|
- run: make clean && rm blake3_sse41_x86-64_unix.S
|
2020-02-12 19:10:24 +01:00
|
|
|
working-directory: ./c
|
|
|
|
- run: BLAKE3_NO_SSE41=1 make test_asm
|
|
|
|
working-directory: ./c
|
2020-02-13 00:23:36 +01:00
|
|
|
- run: make clean && rm blake3_avx2_x86-64_unix.S
|
2020-02-12 19:10:24 +01:00
|
|
|
working-directory: ./c
|
|
|
|
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 make test_asm
|
|
|
|
working-directory: ./c
|
2020-02-13 00:23:36 +01:00
|
|
|
- run: make clean && rm blake3_avx512_x86-64_unix.S
|
2020-02-12 19:10:24 +01:00
|
|
|
working-directory: ./c
|
|
|
|
- run: BLAKE3_NO_SSE41=1 BLAKE3_NO_AVX2=1 BLAKE3_NO_AVX512=1 make test_asm
|
|
|
|
working-directory: ./c
|