-
-
Notifications
You must be signed in to change notification settings - Fork 326
70 lines (68 loc) · 2.25 KB
/
pythonpackage.yml
File metadata and controls
70 lines (68 loc) · 2.25 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
62
63
64
65
66
67
68
69
70
name: Python package
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
relevant: ${{ steps.filter.outputs.relevant }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- id: filter
uses: dorny/paths-filter@v3
with:
filters: |
relevant:
- "commitizen/**"
- "tests/**"
- ".github/workflows/**"
python-check:
needs: detect_changes
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
platform: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: No relevant changes, fast-path success
if: ${{ needs.detect_changes.outputs.relevant != 'true' }}
run: |
echo "No relevant file changes; skipping tests and linters."
- uses: actions/checkout@v6
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
run: |
uv --version
uv sync --frozen --group base --group test --group linters
- name: Run tests and linters
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
uv run --no-sync poe ci
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
if: ${{ needs.detect_changes.outputs.relevant == 'true' && !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results