Repository navigation
67 lines (67 loc) · 1.9 KB
/
Copy pathpre-commit.yml
File metadata and controls
67 lines (67 loc) · 1.9 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
56
57
58
59
60
61
62
63
64
65
66
67
name: Linting
on:
push:
branches:
- develop
- 'release-v**'
pull_request:
branches:
- develop
- 'release-v**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
env:
# Skips setuptools_scm's `git archive` file listing; see Makefile.
SETUPTOOLS_SCM_IGNORE_VCS_ROOTS: ${{ github.workspace }}
jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
timeout-minutes: 10
# Map a step output to a job output
outputs:
lint: ${{ steps.filter.outputs.lint }}
steps:
# paths-filter needs a checkout to diff push events
- uses: actions/checkout@v7.0.1
- id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
predicate-quantifier: every
# Not '!**.po': picomatch applies that negation at the repo root only.
filters: |
lint:
- '!**/*.po'
- '!**/*.json'
linting:
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.lint == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7.0.1
- name: Set up uv
uses: astral-sh/setup-uv@v10.2.0
with:
# Don't cache, only saves 1-2s per run.
enable-cache: false
- name: Install Python
run: uv python install 3.11
- name: Install dev dependencies
run: uv sync --group dev --python 3.11
- name: Install pnpm
uses: pnpm/action-setup@v6.1.0
- name: Use Node.js
uses: actions/setup-node@v7
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run prek
run: uv run prek run --all-files