-
Notifications
You must be signed in to change notification settings - Fork 29
68 lines (55 loc) · 1.97 KB
/
python-package.yml
File metadata and controls
68 lines (55 loc) · 1.97 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- name: Install SuiteSparse (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libsuitesparse-dev
- name: Install SuiteSparse (macOS)
if: runner.os == 'macOS'
run: brew install suite-sparse
- name: Set up Python ${{ matrix.python-version }} (non-Windows)
if: runner.os != 'Windows'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up conda with Python and SuiteSparse (Windows)
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-activate-base: false
activate-environment: test-env
channels: conda-forge
- name: Install SuiteSparse via conda (Windows)
if: runner.os == 'Windows'
shell: bash -el {0}
run: conda install -c conda-forge suitesparse --yes
- name: Install dependencies (non-Windows)
if: runner.os != 'Windows'
run: python -m pip install .[test]
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: bash -el {0}
run: python -m pip install .[test]
- name: Test with pytest (non-Windows)
if: runner.os != 'Windows'
run: pytest
- name: Test with pytest (Windows)
if: runner.os == 'Windows'
shell: bash -el {0}
run: pytest