-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (77 loc) · 2.24 KB
/
Copy pathci.yml
File metadata and controls
93 lines (77 loc) · 2.24 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.os }} / Python ${{ matrix.python }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
run: uv python install ${{ matrix.python }}
- name: Install dev dependencies
run: uv sync --group dev
- name: Run pytest with coverage
run: |
uv run pytest \
--cov=proxyctl \
--cov-report=term-missing \
--cov-report=xml \
--cov-report=html \
--junitxml=junit.xml \
-v
- name: Coverage summary
if: always()
run: |
echo "## Coverage (${{ matrix.os }} / Python ${{ matrix.python }})" >> $GITHUB_STEP_SUMMARY
uv run coverage report --format=markdown >> $GITHUB_STEP_SUMMARY || true
- name: Upload coverage XML
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
uses: actions/upload-artifact@v7
with:
name: coverage-xml
path: coverage.xml
if-no-files-found: warn
- name: Upload coverage HTML
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
uses: actions/upload-artifact@v7
with:
name: coverage-html
path: htmlcov/
if-no-files-found: warn
build:
name: Build distribution
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build sdist & wheel
run: uv build
- name: Check distribution metadata
run: uvx twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/