-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.39 KB
/
pre-commit.yaml
File metadata and controls
56 lines (53 loc) · 1.39 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
name: Pre-commit
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
branches:
- main
jobs:
lint:
name: Ruff && MyPy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.8.0"
enable-cache: true
- name: Restore cached venv
uses: actions/cache@v4
with:
path: |
./.venv
~/.local/share/uv
key: venv-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
- name: Install dependencies
run: uv sync --group lint
- name: Run linting with pre-commit
run: uv run pre-commit run --all-files
release:
name: "Semantic Release"
runs-on: ubuntu-latest
needs: [lint]
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install python-semantic-release
run: pip install python-semantic-release
- name: Generate version
id: set-version
run: |
VERSION=$(semantic-release version --print-last-released)-${{ github.run_id }}
echo "version=$VERSION" >> $GITHUB_OUTPUT