forked from luminartech/dev-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (71 loc) · 2.52 KB
/
Copy pathcheck.yaml
File metadata and controls
76 lines (71 loc) · 2.52 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
68
69
70
71
72
73
74
75
76
name: Check
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
packages: read
jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.14"
- run: uv sync --extra dev # for ty
- run: SKIP=no-commit-to-branch uvx prek run --all-files --show-diff-on-failure --color=always
check:
runs-on: ubuntu-latest
name: test with ${{ matrix.py }}
strategy:
fail-fast: false
matrix:
py:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: ${{ matrix.py }}
- name: Sync deps
run: uv sync --extra dev --locked
- name: Run test suite
run: uv run pytest --import-mode importlib
- name: Build all packages
run: uv build --all-packages
e2e-tests:
runs-on: ubuntu-latest
name: run ${{ matrix.tool }} try-repo on all files
strategy:
fail-fast: false
matrix:
tool:
- pre-commit
- prek
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.14"
- name: Prepare local package constraints
run: |
echo "whoowns @ file://${PWD}/packages/whoowns" > constraints-e2e.txt
echo "pre-commit-excludes @ file://${PWD}/packages/pre_commit_excludes" >> constraints-e2e.txt
- name: Run ${{ matrix.tool }} try repo
env:
# Do not set UV_CONSTRAINT here: prek/uv already resolves local packages from the copied try-repo workspace.
# Constraining uv to the original checkout creates conflicting file URLs for the same package.
PIP_CONSTRAINT: ${{ github.workspace }}/constraints-e2e.txt
run: SKIP=check-jira-reference-in-todo,go-revive,go-fmt,go-imports,check-number-of-lines-count uvx "${{ matrix.tool }}" try-repo "$PWD" --all-files --color=always --verbose