Adding per PR tests. #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Rust toolchain 1.74 (with clippy and rustfmt) | |
run: rustup toolchain install 1.74-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.74-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.74-x86_64-unknown-linux-gnu | |
- name: Format | |
run: cargo fmt --all --check --verbose | |
- name: Lint | |
run: cargo clippy --all --all-targets --all-features --profile pr-tests -- -D warnings | |
- name: Build | |
run: cargo build --all --all-targets --all-features --profile pr-tests | |
- uses: taiki-e/install-action@nextest | |
- name: Run tests | |
run: cargo nextest run --workspace --all-features --all-targets --profile pr-tests |