2022-11-30 01:17:34 +01:00
|
|
|
name: tests
|
2022-07-16 21:45:04 +02:00
|
|
|
|
2022-07-26 11:45:12 +02:00
|
|
|
on:
|
2022-09-16 15:22:00 +02:00
|
|
|
push:
|
2022-11-28 18:20:31 +01:00
|
|
|
branches: [main]
|
2022-09-16 15:22:00 +02:00
|
|
|
pull_request:
|
2022-07-16 21:45:04 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-11-30 01:17:34 +01:00
|
|
|
tests:
|
|
|
|
name: tests
|
2022-11-28 18:20:31 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
rust:
|
|
|
|
- 'stable'
|
|
|
|
- 'nightly'
|
|
|
|
os:
|
|
|
|
- 'ubuntu-latest'
|
2022-09-11 21:46:34 +02:00
|
|
|
|
|
|
|
steps:
|
2022-11-28 18:20:31 +01:00
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: install rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
2022-09-11 21:46:34 +02:00
|
|
|
with:
|
2022-11-28 18:20:31 +01:00
|
|
|
toolchain: ${{ matrix.rust }}
|
2022-09-11 21:46:34 +02:00
|
|
|
override: true
|
2022-11-28 18:20:31 +01:00
|
|
|
components: rustfmt, clippy
|
|
|
|
|
2022-12-07 09:32:36 +01:00
|
|
|
- name: cache
|
|
|
|
uses: Swatinem/rust-cache@v2.0.0
|
|
|
|
|
2022-11-28 18:20:31 +01:00
|
|
|
- name: check
|
|
|
|
if: matrix.rust == 'stable'
|
2022-12-07 14:37:11 +01:00
|
|
|
run: |
|
|
|
|
cargo fmt --all -- --check
|
|
|
|
cargo clippy
|
2022-12-01 01:33:38 +01:00
|
|
|
|
2022-11-28 18:20:31 +01:00
|
|
|
- name: test
|
2022-12-07 14:37:11 +01:00
|
|
|
run: cargo test --all -- --skip third_party
|
2022-12-06 13:47:55 +01:00
|
|
|
|
|
|
|
- name: bench
|
|
|
|
if: matrix.rust == 'stable'
|
2022-12-07 14:37:11 +01:00
|
|
|
run: |
|
|
|
|
cargo install hyperfine
|
|
|
|
hyperfine --prepare "cargo build -r" --runs 10 --warmup 2 -i "cargo test --all -r"
|