-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflow] Extract linting into a reusable workflow (#953)
* Extract linting into a reusable workflow
- Loading branch information
1 parent
5e5811d
commit eafa3da
Showing
3 changed files
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Linting (reusable) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
working-directory: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
with: | ||
working-directory: ${{ inputs.working-directory }} | ||
components: rustfmt, clippy | ||
|
||
- name: cargo fmt | ||
run: cargo fmt --all -- --check --config imports_granularity=Crate | ||
working-directory: ${{ inputs.working-directory }} | ||
|
||
- name: cargo clippy | ||
run: cargo clippy --all --all-targets --all-features -- -D warnings | ||
working-directory: ${{ inputs.working-directory }} |