diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d641138..64e15b8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,28 +1,71 @@ -name: Rust Test and Benchmark - -on: - push: - branches: - - master +on: pull_request: - types: [opened, synchronize] + branches: + - main workflow_dispatch: + push: + branches: + - main + +name: Continuous integration jobs: - build: + check: + name: Check runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: + profile: minimal toolchain: stable - - - uses: actions-rs/cargo@v1.0.1 + override: true + - uses: actions-rs/cargo@v1 with: command: check - - uses: actions-rs/cargo@v1.0.1 + test: + name: Test Suite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 with: command: test + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings