-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.3 KB
/
Copy pathpython.yaml
File metadata and controls
85 lines (71 loc) · 2.3 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
77
78
79
80
81
82
83
84
85
name: Python
on:
pull_request:
paths: &python-paths
- .github/workflows/python.yaml
- .python-version
- .tool-versions
- pyproject.toml
- uv.lock
- '**/*.py'
- ansible/roles/system/templates/macos/tailscale-ssh-helper.py.in
- browser/helium.toml
- browser/settings/**
- dotfiles/.chezmoitemplates/catppuccin_palette.json
- npins/sources.json
- packages/dotfiles-python/assets/**
push:
branches:
- master
paths: *python-paths
workflow_dispatch: null
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: read # needed to checkout repository contents
jobs:
quality:
name: Astral Quality Gate
# Immutable GitHub bot IDs: Renovate, GitHub Actions, Dependabot.
if: >-
github.event_name != 'pull_request' ||
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) ||
(github.event.pull_request.user.type == 'Bot' &&
contains(fromJSON('[29139614, 41898282, 49699333]'), github.event.pull_request.user.id))
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
UV_LOCKED: "1"
steps:
- name: Checkout Repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv and Python
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
with:
enable-cache: true
version-file: .tool-versions
- name: Verify Locked Environment
env:
UV_MALWARE_CHECK: "1"
run: |
uv lock --check
uv sync
- name: Run Ruff
run: uv run ruff check --output-format github .
- name: Check Cognitive Complexity
run: uv run complexipy --plain
- name: Run ty
run: uv run ty check --output-format github
- name: Check Python Dependencies
run: uv run deptry . --github-output
- name: Find Dead Python Code
run: uv run vulture
- name: Compile Python Sources
run: uv run python -m compileall -q ansible dotfiles packages
- name: Test
run: uv run pytest
- name: Build Package
run: uv build --no-build-logs