Repository navigation
78 lines (65 loc) · 1.97 KB
/
Copy pathtest.yml
File metadata and controls
78 lines (65 loc) · 1.97 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
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync
- name: Lint
run: |
uv run ruff check localizationkit tests
uv run ruff format --check localizationkit tests
- name: Type Check
run: uv run mypy localizationkit/ tests/
- name: Test
run: uv run pytest tests --cov=localizationkit --cov-report xml --doctest-modules --junitxml=junit/test-results.xml
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results-${{ matrix.python-version }}
path: junit/test-results.xml
test-result:
name: test-result
if: always()
needs: test
runs-on: ubuntu-latest
steps:
- name: Verify all matrix jobs passed
run: |
if [ "${{ needs.test.result }}" != "success" ]; then
echo "One or more test matrix jobs failed."
exit 1
fi
echo "All test matrix jobs passed."