mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-27 13:01:37 +00:00
adjust lint workflow
This commit is contained in:
parent
cb073a0db7
commit
eb82ae603d
23
.github/workflows/lint.yml
vendored
23
.github/workflows/lint.yml
vendored
@ -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"
|
||||
|
15
ci/lint.sh
15
ci/lint.sh
@ -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
|
Loading…
x
Reference in New Issue
Block a user