mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-02 15:26:12 +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:
|
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"
|
|
||||||
|
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