-
Notifications
You must be signed in to change notification settings - Fork 39
97 lines (81 loc) · 2.63 KB
/
Copy pathtests.yml
File metadata and controls
97 lines (81 loc) · 2.63 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Tests
on:
pull_request:
push:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true
jobs:
delete-cancelled-runs:
permissions:
actions: write
runs-on: 'ubuntu-latest'
steps:
- uses: 'MercuryTechnologies/delete-cancelled-runs@1.0.0'
with:
workflow-file: 'tests.yml'
max-deletions: 3
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
mpi: [openmpi]
include:
- os: macos-latest
python-version: "3.13"
mpi: openmpi
- os: windows-latest
python-version: "3.13"
mpi: msmpi
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 1
- name: Set up uv
uses: astral-sh/setup-uv@v10.0.0
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Set up MPI
uses: mpi4py/setup-mpi@v1.4.4
with:
mpi: ${{ matrix.mpi }}
- name: Install dependencies
run: uv sync --extra dev
- name: List Python package versions
run: uv pip list
- name: Run tests (Linux and macOS)
if: runner.os != 'Windows'
env:
COVERAGE_FILE: ${{ runner.temp }}/.coverage
run: uv run pytest -n auto --cov --cov-branch --cov-report=xml
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
COVERAGE_FILE: ${{ runner.temp }}/.coverage
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * `
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
-property installationPath
if (-not $vsPath) {
throw "MSVC installation not found"
}
$devShell = Join-Path $vsPath "Common7\Tools\Launch-VsDevShell.ps1"
& $devShell -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
Get-Command cl -ErrorAction Stop
uv run pytest -n auto --cov --cov-branch --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}