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

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