-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.75 KB
/
Copy pathci.yml
File metadata and controls
62 lines (50 loc) · 1.75 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev
- name: Lint with ruff
if: matrix.python-version == '3.13'
run: uv run ruff check src/ tests/
- name: Type check with pyright
if: matrix.python-version == '3.13'
run: uv run pyright src/ tests/
- name: Run tests with coverage
run: uv run pytest --cov=actionable_errors --cov-report=term-missing --cov-report=json
- name: Extract coverage percentage
id: coverage
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.13'
run: |
COVERAGE=$(python -c "import json; print(int(json.load(open('coverage.json'))['totals']['percent_covered']))")
echo "pct=$COVERAGE" >> $GITHUB_OUTPUT
- name: Update coverage badge
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.13'
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ vars.COVERAGE_GIST_ID }}
filename: actionable-errors-coverage.json
label: coverage
message: ${{ steps.coverage.outputs.pct }}%
valColorRange: ${{ steps.coverage.outputs.pct }}
minColorRange: 50
maxColorRange: 100