Repository navigation
83 lines (69 loc) · 2.23 KB
/
Copy pathtests.yml
File metadata and controls
83 lines (69 loc) · 2.23 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
# SPDX-FileCopyrightText: 2025 icalendar-anonymizer contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
lint:
name: Lint with Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint code
run: ruff check .
- name: Check code format
run: ruff format --check .
test:
name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install uv with caching and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v8.2.0
with:
# Install a specific version of uv.
enable-cache: true
version: "0.11.18"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --group test --extra web
uv tree
- name: Run tests
run: uv run pytest --cov --cov-branch --cov-report=xml --cov-report=term --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: ${{ matrix.os }}-python-${{ matrix.python-version }}
name: ${{ matrix.os }}-${{ matrix.python-version }}
fail_ci_if_error: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./junit.xml
flags: ${{ matrix.os }}-python-${{ matrix.python-version }}
report_type: test_results