Repository navigation
100 lines (96 loc) · 2.93 KB
/
Copy pathpython-ci.yml
File metadata and controls
100 lines (96 loc) · 2.93 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Python Checks
on:
push:
branches:
- main
pull_request:
permissions: {}
jobs:
python-ci:
name: Python ${{ matrix.python }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python: ['3.13', '3.14', '3.15']
env:
UV_LOCKED: '1'
UV_CACHE_DIR: /home/runner/.cache/uv
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: ${{ matrix.python }}
enable-cache: false
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
.venv
.mypy_cache
/home/runner/.cache/uv
key: python-${{ matrix.python }}-deps-${{ hashFiles('uv.lock') }}
restore-keys: |
python-${{ matrix.python }}-deps-
- name: Install Task
uses: go-task/setup-task@a00fbb05ce67b35648be3c78cbc9fd85354c757e # v2.2.0
with:
repo-token: ${{ github.token }}
- name: Install Python
run: uv python install ${{ matrix.python }}
- name: Install dependencies
run: task install
- name: Format, lint, and type checks
run: task check
- name: Tests
run: task test
- name: Build
run: uv build
- name: Prune the uv cache
run: uv cache prune --ci
infra-scan:
name: Scan with KICS
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: KICS scan
uses: Checkmarx/kics-github-action@4a16c2130b02104dc2624c133d5224080e7cc49b # v2.2.1
with:
path: .
output_path: kics_results.sarif
output_formats: sarif
fail_on: high,medium
token: ${{ github.token }}
enable_comments: true
enable_annotations: true
enable_jobs_summary: true
comments_with_queries: true
actions-scan:
name: GitHub Actions security analysis
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: reviewdog/action-actionlint@ae857e78c1b42b3d0a49637181b09d3d56d402b4 # v1.84.1
continue-on-error: true
with:
fail_level: any
filter_mode: nofilter
tool_name: actionlint
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: false
- name: Run zizmor
run: uvx zizmor@1.32.0 --offline --format github .