-
-
Notifications
You must be signed in to change notification settings - Fork 462
55 lines (51 loc) · 1.88 KB
/
Copy pathlint.yml
File metadata and controls
55 lines (51 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Lint
on:
push:
branches: [main, 3.1.x]
pull_request:
branches: [main, 3.1.x]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
enable-cache: true
- name: Install just
uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
with:
repo: casey/just
version: 1.58.0
# `uvx prek` builds each hook's environment from scratch, so cache them the
# way the prek action used to. Keyed on the hook config: a new pinned rev or
# a new hook is exactly when the cached environments stop being valid.
- name: Cache prek hook environments
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/prek
# Justfile is hashed too: prek_version lives there, and a bumped prek
# must not restore a store built by the previous one. No restore-keys
# fallback for the same reason.
key: prek-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml', 'Justfile') }}
- name: Lint
run: just lint
- name: Check justfile formatting
# After the linters, and never masking them: this is cosmetic, and a
# mis-formatted recipe should not cost someone their ruff/mypy results.
if: always()
run: just just-check