redsunlib/.github/workflows/pull-request.yml

67 lines
1.4 KiB
YAML
Raw Normal View History

2023-06-01 11:47:58 +12:00
name: Pull Request
env:
CARGO_TERM_COLOR: always
NEXTEST_RETRIES: 10
2023-06-01 11:47:58 +12:00
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
2023-06-01 11:47:58 +12:00
- name: Run cargo nextest
run: cargo nextest run
2023-06-01 11:47:58 +12:00
format:
name: cargo fmt --all -- --check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain with rustfmt component
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
clippy:
name: cargo clippy -- -D warnings
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain with clippy component
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Run cargo clippy
run: cargo clippy -- -D warnings