Minor tweak #194
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
name: Lint codebase | |
"on": | |
push: | |
branches: ["**"] | |
tags-ignore: ["**"] | |
pull_request: | |
branches: [main] | |
jobs: | |
lint: | |
name: Run pre-commit | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
# Without the below, the "npx" commands in pre-commit sometimes trip | |
# up... See <https://stackoverflow.com/a/66159119> | |
with: | |
persist-credentials: false | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pre-commit | |
~/.cache/pip | |
~/.npm | |
~/.local/bin | |
# Only restore on exact match – the manually pulled in binaries are | |
# not version checked prior to execution. Restoring a stale cache | |
# would result in using outdated versions... | |
# yamllint disable-line rule:quoted-strings | |
key: "pre-commit-cache-\ | |
${{ hashFiles('.github/scripts/setup-pre-commit.sh') }}" | |
- name: Install dependencies | |
env: | |
USE_PIPX: "false" | |
run: .github/scripts/setup-pre-commit.sh | |
shell: bash | |
- name: Run pre-commit | |
env: | |
SKIP: notebook-cells | |
run: pre-commit run --color=always --all-files | |
shell: bash |