Repository navigation
61 lines (61 loc) · 1.56 KB
/
Copy pathpython.yml
File metadata and controls
61 lines (61 loc) · 1.56 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
57
58
59
60
61
name: Python
on:
push:
branches:
- main
# pull_request:
# branches:
# - main
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
python-test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version-file: "pyproject.toml"
- name: Run tests
env:
PYTHONPATH: ${{ github.workspace }}
run: uv run --with pytest --no-project pytest tests
python-lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version-file: "pyproject.toml"
- name: Install ruff
run: uv pip install --system ruff
- name: Lint code with Ruff
run: ruff check --output-format=github
- name: Check code formatting with Ruff
run: ruff format --check --diff
python-check:
if: always()
needs:
- python-test
- python-lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Alls Green
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}