-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (131 loc) · 5.49 KB
/
Copy pathci.yaml
File metadata and controls
135 lines (131 loc) · 5.49 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: ci
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
id-token: write
pull-requests: write
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.name }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- name: test
task: test
install: true
annotations_pytest: true
- name: pre-commit
task: install
install: true
pre_commit: true
- name: template - build
task: build
template: true
buildx: true
- name: template - check - format
task: check:format
template: true
install: true
annotations_ruff: true
- name: template - check - lint
task: check:lint
template: true
install: true
annotations_ruff: true
- name: template - check - types
task: check:types
template: true
install: true
annotations_mypy: true
- name: template - test - 3.10
task: test
template: true
install: true
python: "3.10"
- name: template - test - 3.11
task: test
template: true
install: true
python: "3.11"
- name: template - test - 3.12
task: test
template: true
install: true
python: "3.12"
- name: template - test - 3.13
task: test
template: true
install: true
python: "3.13"
- name: template - test - 3.14
task: test
template: true
install: true
python: "3.14"
annotations_pytest: true
pytest_coverage: true
pytest_coverage_xml: tests/example-project/coverage.xml
pytest_coverage_junit: tests/example-project/pytest.xml
- name: template - pre-commit
task: install
template: true
install: true
pre_commit: true
steps:
- name: lock template project
if: matrix.template || false
uses: juftin/actions/taskfile@v1
with:
task: lock
task-args: --taskfile tests/example-project/Taskfile.yaml
checkout: true
fetch-depth: ${{ matrix.pre_commit && '0' || '1' }}
setup-uv: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: install template project
if: matrix.template && matrix.install
uses: juftin/actions/taskfile@v1
with:
task: install
task-args: --taskfile tests/example-project/Taskfile.yaml
setup-task: false
setup-uv: false
- name: ${{ matrix.name }}
uses: juftin/actions/taskfile@v1
with:
task: ${{ matrix.task }}
task-args: ${{ matrix.template && '--taskfile tests/example-project/Taskfile.yaml' || '' }}
checkout: ${{ !matrix.template }}
install: ${{ matrix.install || false }}
fetch-depth: ${{ matrix.pre_commit && '0' || '1' }}
setup-task: ${{ !matrix.template }}
setup-uv: ${{ !matrix.template }}
buildx: ${{ matrix.buildx || false }}
github-token: ${{ secrets.GITHUB_TOKEN }}
annotations-ruff: ${{ matrix.annotations_ruff || false }}
annotations-mypy: ${{ matrix.annotations_mypy || false }}
annotations-pytest: ${{ matrix.annotations_pytest || false }}
pytest-coverage: ${{ matrix.pytest_coverage && github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork || false }}
pytest-coverage-xml: ${{ matrix.pytest_coverage_xml || 'coverage.xml' }}
pytest-coverage-junit: ${{ matrix.pytest_coverage_junit || 'pytest.xml' }}
env:
UV_PYTHON: ${{ matrix.python || '' }}
- name: pre-commit
if: matrix.pre_commit && github.event_name == 'pull_request'
run: |
uv tool run --isolated \
--with pre-commit-uv \
pre-commit run \
--color always \
--from-ref ${{ github.event.pull_request.base.sha }} \
--to-ref ${{ github.event.pull_request.head.sha }}