ci: split tasks into their own workflows

This commit is contained in:
Mathew Davies 2023-05-26 19:02:59 +00:00
parent 7b9d416d86
commit 1ab6090ce8
3 changed files with 78 additions and 19 deletions

34
.github/workflows/rust-clippy.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Rust Clippy
on:
push:
branches:
- 'main'
- 'master'
pull_request:
branches:
- 'main'
- 'master'
jobs:
check:
name: Clippy check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install minimal stable with clippy component
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
- name: Annotate commit with clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

34
.github/workflows/rust-fmt.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Rust Fmt
on:
push:
branches:
- 'main'
- 'master'
pull_request:
branches:
- 'main'
- 'master'
jobs:
check:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install minimal stable with rustfmt component
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

View File

@ -1,13 +1,15 @@
name: Tests
name: Rust Tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
push:
branches:
- 'main'
- 'master'
env:
CARGO_TERM_COLOR: always
pull_request:
branches:
- 'main'
- 'master'
jobs:
test:
@ -17,22 +19,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install minimal stable with clippy and rustfmt
- name: Install minimal stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy, rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
- name: Run cargo test
uses: actions-rs/cargo@v1