generated from S1M0N38/template-python
-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (55 loc) · 1.33 KB
/
code-quality.yml
File metadata and controls
55 lines (55 loc) · 1.33 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
permissions:
contents: read
pull-requests: write
name: Code Quality
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ruff Check
uses: astral-sh/ruff-action@v3
with:
version: latest
- name: Ruff Format
uses: astral-sh/ruff-action@v3
with:
version: latest
args: format --check
ty:
name: Type Check & Markdown Format
runs-on: ubuntu-latest
needs: ruff
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv venv
uv sync --group dev --group test
- name: Check markdown formatting
run: |
source .venv/bin/activate
mdformat --check .
- name: Run ty
run: |
source .venv/bin/activate
ty check