-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (50 loc) · 1.53 KB
/
main.yaml
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
name: Check merge requirements
on:
pull_request: ~
jobs:
pre-commit:
name: Prepare pre-commit base
runs-on: ubuntu-24.04
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras --dev
- name: Install pre-commit dependencies
run: |
uv run pre-commit install-hooks
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
python:
- '**/*.py'
mapping_yaml:
- 'mapping.yaml'
icons:
- 'icons_linux/**'
- name: Run ruff-format
if: steps.filter.outputs.python == 'true'
run: |
uv run pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
- name: Run ruff
if: steps.filter.outputs.python == 'true'
run: |
uv run pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
- name: Validate mapping
if: steps.filter.outputs.mapping_yaml == 'true'
run: |
uv run pre-commit run --hook-stage manual validate_mapping