-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.26 KB
/
python.yml
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
name: Python
on:
push:
branches: ["master", "ci-test"]
paths: ["**/*.py", "Pipfile.lock", "pyproject.toml"]
pull_request:
branches: ["master", "ci-test"]
paths: ["**/*.py", "Pipfile.lock", "pyproject.toml"]
jobs:
pyright:
name: Pyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pipenv
- name: Setup pipenv
run: pipx install pipenv && pipenv sync
- name: Activate venv
run: echo "$(pipenv --venv --quiet)/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v2
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Ruff
run: pipx run ruff check --output-format github
black:
name: Black
needs: ["pyright", "ruff"]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Ruff
run: pipx install ruff
- name: Run isort
run: ruff check --select I --fix
- name: Run Black
run: ruff format
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: black + isort"