-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (61 loc) · 2.25 KB
/
test.yml
File metadata and controls
75 lines (61 loc) · 2.25 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
name: Test
on:
push:
branches: [main]
pull_request:
branches: "*"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python: ["3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
id: setup-uv
with:
version: "latest"
python-version: ${{ matrix.python }}
enable-cache: true
- name: Install dependencies
run: "uv sync"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: uv run pytest --cov --color=yes --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
name: coverage
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build Wheel
run: "uv build"
- name: Setup MicroMamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: build_test_env
create-args: >-
python=${{ matrix.python }}
cache-downloads: true
- name: Install Wheel on Windows
if: runner.os == 'Windows'
run: |
$whl = Get-ChildItem -Path dist/*.whl | Select-Object -First 1
micromamba run -n build_test_env python -m pip install $whl.FullName
- name: Install Wheel on Linux/macOS
if: runner.os != 'Windows'
run: micromamba run -n build_test_env pip install dist/*.whl
- name: Verify Installation
run: micromamba run -n build_test_env python -c "import opendvp; print('Successfully installed and imported package into Conda environment.')"
- name: Minimize uv cache
run: uv cache prune --ci