-
Notifications
You must be signed in to change notification settings - Fork 10
56 lines (54 loc) · 1.6 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
53
54
55
56
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: Set up Python
uses: actions/[email protected]
with:
check-latest: true
- name: Create Python virtual environment
run: |
python -m venv venv
. venv/bin/activate
python --version
pip install uv
uv pip install -r requirements.txt
- name: Install pre-commit dependencies
run: |
. venv/bin/activate
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: |
. venv/bin/activate
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: |
. venv/bin/activate
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: |
. venv/bin/activate
pre-commit run --hook-stage manual validate_mapping