-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Run pre-commit checks automatically
- Loading branch information
1 parent
9655ff0
commit 00e2ee9
Showing
1 changed file
with
20 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,22 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- name: Install pre-commit & gitlint | ||
run: python -m pip install pre-commit gitlint | ||
- run: python -m pip freeze --local | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: pre-commit validation | ||
run: pre-commit run --show-diff-on-failure --color=always --from-ref ${{ github.event.pull_request.base.sha || github.event.before || github.sha }}~ --to-ref ${{ github.sha }} | ||
- name: gitlint validation | ||
run: gitlint --commits ${{ github.event.pull_request.base.sha || github.event.before || github.sha }}~..${{ github.sha }} | ||
if: always() | ||
- name: Formatting | ||
run: cargo fmt --all --check | ||
- name: Linting | ||
|
@@ -31,3 +47,7 @@ jobs: | |
run: cargo check | ||
- name: Tests | ||
run: cargo test | ||
- uses: pre-commit-ci/[email protected] | ||
if: always() | ||
with: | ||
msg: "chore: Apply automatic fixes" |