-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (69 loc) · 2.07 KB
/
test.yml
File metadata and controls
73 lines (69 loc) · 2.07 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
name: PyTest
on:
workflow_call:
workflow_dispatch:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/test.yml"
- "render_engine_api/**"
- "tests/**"
- "pyproject.toml"
- "requirements.txt"
jobs:
gen-coverage-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
- name: run coverage and generate cov-report
run: |
uv run --dev pytest --cov-report xml
- name: genbadge coverage
run: |
uvx --with "genbadge[coverage]" genbadge coverage -i coverage.xml
- name: Commit Badge
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: Update coverage badge [skip ci]
file_pattern: coverage.svg
test-against-python-matrix:
# Only test all the supported versions when a pull request is made or the workflow is called
if: ${{github.event_name == 'workflow_call'}} || ${{github.event_name == 'pull_request'}}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: true
steps:
- uses: actions/checkout@v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true # caching dependencies
- name: Run tests
run: |
uv run --dev pytest tests
test-against-latest-os:
# Always run against the latest version on both Windows, Linux, MacOS
if: github.event.pull_request.user.login != 'dependabot[bot]'
strategy:
matrix:
os: [windows-latest, macos-latest]
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true # caching dependencies
- name: run tests
run: uv run --dev pytest tests