Repository navigation
127 lines (118 loc) · 4.11 KB
/
Copy pathci.yaml
File metadata and controls
127 lines (118 loc) · 4.11 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
---
name: CI
on:
# Allow this config to be reused by other workflows in the repo
workflow_call:
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.event.number || 'main' }}
cancel-in-progress: true
jobs:
preview:
name: Release preview
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Generate notes
id: notes
uses: open-turo/actions-release/semantic-release@4d8a6b6aa2d051e7dba0429d8d08beef827b5ccd # v4
with:
branches: ${{ github.head_ref }}
override-github-ref-name: ${{ github.head_ref }}
dry-run: true
ci: false
- name: Find Comment
uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2
id: find
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: release-notes-preview
- name: Comment preview
uses: peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d # v2
if: steps.notes.outputs.new-release-notes != ''
with:
comment-id: ${{ steps.find.outputs.comment-id }}
issue-number: ${{ github.event.number }}
edit-mode: replace
body: |
<!-- release-notes-preview -->
## Release notes preview
${{ steps.notes.outputs.new-release-notes }}
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version: ${{ matrix.python-version }}
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
with:
version: "0.7.12"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Pytest
uv sync --locked --all-extras --dev
uv run pytest --cov
uv run coveralls
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version-file: ".python-version"
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Build docs
uv run script/docs
checks:
name: Checks
needs: [lint, test, docs]
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Renovate / Auto-approve
if: github.actor == 'renovatebot' || github.actor == 'renovate[bot]'
uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Renovate / Auto-merge
if: github.actor == 'renovatebot' || github.actor == 'renovate[bot]'
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 # v0.15.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: dependencies
MERGE_METHOD: rebase