-
Notifications
You must be signed in to change notification settings - Fork 5
98 lines (85 loc) · 2.64 KB
/
ci.yml
File metadata and controls
98 lines (85 loc) · 2.64 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
98
name: CI
on:
push:
branches: [ main, master ]
tags: [ 'v*' ]
pull_request:
schedule:
# Every Monday at 06:00 UTC.
- cron: "0 6 * * 1"
workflow_dispatch:
jobs:
test:
name: Test (${{ matrix.os }} / py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test-env
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channels: conda-forge
channel-priority: strict
# MKL Pardiso is not available on macOS.
- name: Install MKL Pardiso
if: matrix.os != 'macos-latest'
shell: bash -l {0}
run: pip install py-mkl-pardiso
# Petsc4py is not available on Windows
- name: Install POSIX-only dependencies
if: matrix.os != 'windows-latest'
shell: bash -l {0}
run: conda install -y -c conda-forge petsc4py
# macldlt (Apple Accelerate) is macOS only
- name: Install macldlt (macOS only)
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: python -m pip install macldlt
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y -c conda-forge suitesparse scikit-umfpack nanoeigenpy
python -m pip install 'scikit-sparse>=0.5'
python -m pip install -U pip
python -m pip install qdldl pytest
python -m pip install -e .[test] || python -m pip install -e .
- name: Run tests
shell: bash -l {0}
run: |
pytest
build-and-publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [test]
name: Build & Publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: pip
- name: Build sdist and wheel
run: |
python -m pip install -U pip build
python -m build
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/*
- name: Publish to PyPI (Trusted Publishing)
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true