adjust lint workflow

This commit is contained in:
Eric Sheppard 2022-09-02 22:03:36 +10:00 committed by Dirkjan Ochtman
parent cb073a0db7
commit eb82ae603d
2 changed files with 11 additions and 27 deletions

View File

@ -2,8 +2,13 @@ name: lint
on:
push:
branches: [main, master, 0.4.x]
branches: [main, 0.4.x]
pull_request:
paths:
- "**.rs"
- .github/**
- .ci/**
- Cargo.toml
jobs:
lint:
@ -11,15 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- name: Lint
run: bash ci/lint.sh
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@0.3.0
with:
check_together: "y"
- run: cargo fmt -- --check --color=always
- run: cargo clippy --color=always -- -D warnings -A clippy::manual-non-exhaustive
env:
RUSTFLAGS: "-Dwarnings"

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# shellcheck source=ci/_shlib.sh
source "${BASH_SOURCE[0]%/*}/_shlib.sh"
main() {
# rustflags are present because of: https://github.com/rust-lang/rust-clippy/issues/5749
runt env RUSTFLAGS="-Dwarnings" cargo clippy --color=always -- -D warnings -A clippy::manual-non-exhaustive
runt cargo fmt -- --check --color=always
runv git diff --exit-code -- README.md
}
main