Skip to content

Commit

Permalink
ci: Run pre-commit checks automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedBlueEyes committed Jun 4, 2024
1 parent 9655ff0 commit 00e2ee9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

0 comments on commit 00e2ee9

Please sign in to comment.