forked from mapnik/python-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.08 KB
/
Copy pathtest.yml
File metadata and controls
80 lines (69 loc) · 2.08 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
name: Test
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
workflow_call:
jobs:
test:
runs-on: ubuntu-latest
container:
image: python:3.12-bookworm
permissions:
contents: read
checks: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Add Debian sid repository
run: |
echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list.d/sid.list
echo 'Package: *\nPin: release a=sid\nPin-Priority: 100' > /etc/apt/preferences.d/sid
- name: Install system dependencies
run: |
apt-get update
apt-get install -y build-essential pkg-config libbz2-dev
apt-get install -y -t sid libmapnik-dev fonts-noto-cjk
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Python dependencies and build package
run: |
uv sync --frozen --verbose || uv sync --verbose
- name: Run tests with coverage
run: |
uv run pytest test/python_tests -v \
--cov=mapnik \
--cov-report=term \
--cov-report=xml:coverage.xml \
--cov-report=html:htmlcov \
--junitxml=junit.xml
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-reports
path: |
coverage.xml
htmlcov/
junit.xml
retention-days: 30
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: junit.xml
check_name: Test Results
comment_mode: off
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: always()
with:
files: ./coverage.xml
flags: unittests
name: python-mapnik-coverage
fail_ci_if_error: false