Repository navigation
68 lines (61 loc) · 2.23 KB
/
Copy pathci.yml
File metadata and controls
68 lines (61 loc) · 2.23 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
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "17 6 * * 1" # weekly: dependencies resolve fresh, so test and audit what users get now
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
# The same cooldown as action.yml, so tests and the self-audit resolve what users get.
env:
UV_EXCLUDE_NEWER: 7 days
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
- run: uv pip install --system pre-commit==4.2.0
- run: pre-commit run --all-files --show-diff-on-failure --color=always
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
- name: Install package and dev dependencies
run: uv pip install --system -e ".[dev]"
- name: Run tests
run: pytest
security:
name: Security audit
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # Upload SARIF to GitHub code scanning when the audit publishes security events
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
# No committed lock: `uv export` resolves one with the cooldown above, as users get it.
- uses: ./
with:
bandit_scan_dirs: src
package_manager: uv
comment_on: never #${{ github.event_name == 'pull_request' && 'always' || 'never' }}