parser/.github/workflows/tests.yml

49 lines
989 B
YAML
Raw Normal View History

name: tests
2022-07-16 21:45:04 +02:00
2022-07-26 11:45:12 +02:00
on:
push:
2022-11-28 18:20:31 +01:00
branches: [main]
pull_request:
2022-07-16 21:45:04 +02:00
jobs:
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
- name: cache
uses: Swatinem/rust-cache@v2.0.0
2022-11-28 18:20:31 +01:00
- name: check
if: matrix.rust == 'stable'
run: |
cargo fmt --all -- --check
cargo clippy
2022-11-28 18:20:31 +01:00
- name: test
run: cargo test --all -- --skip third_party
- name: bench
if: matrix.rust == 'stable'
run: |
cargo install hyperfine
hyperfine --prepare "cargo build -r" --runs 10 --warmup 2 -i "cargo test --all -r"