-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (87 loc) · 2.26 KB
/
ci.yml
File metadata and controls
107 lines (87 loc) · 2.26 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
name: CI
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: '3.12'
- name: Sync dependencies
run: uv sync --extra dev
- name: Run pre-commit
run: uv run pre-commit run --all-files --show-diff-on-failure
tests:
name: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: '3.12'
- name: Sync dependencies
run: uv sync --extra dev
- name: Run tests
run: uv run pytest
semantic-release:
name: semantic-release
needs:
- pre-commit
- tests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: '3.12'
- name: Sync dependencies
run: uv sync --extra dev
- name: Configure git author
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: uv run semantic-release version
semantic-release-dry-run:
name: semantic-release (dry-run)
needs:
- pre-commit
- tests
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: '3.12'
- name: Sync dependencies
run: uv sync --extra dev
- name: Dry-run semantic-release
run: uv run semantic-release version --print