-
Notifications
You must be signed in to change notification settings - Fork 16
145 lines (127 loc) · 3.55 KB
/
python-package-conda.yml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Testing
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
build-and-test:
name: Testing (${{ matrix.python-version }} on ${{ matrix.os }}) with ${{ matrix.solver }}.
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
# NOTE: macOS-13 is the last Intel runner.
os: [ubuntu-latest, windows-latest, macOS-13, macOS-latest]
solver: [mumps, pardiso]
python-version : ['3.10', '3.11', '3.12']
exclude:
- os: macOS-latest
solver: pardiso
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
python-version: ${{ matrix.python-version }}
- name: Install Base Env
run: |
conda info
conda list
conda config --show
conda install --quiet --yes pip numpy scipy pytest pytest-cov
- name: Install MKL solver interface
if: ${{ matrix.solver == 'pardiso' }}
run:
conda install --quiet --yes "pydiso>=0.1"
- name: Install MUMPS solver interface
if: ${{ matrix.solver == 'mumps' }}
run:
conda install --quiet --yes python-mumps
- name: Install Our Package
run: |
pip install -v -e .
conda list
- name: Run Tests
run: |
make coverage
- name: Generate Source Distribution
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.11') }}
run: |
pip install build twine
python -m build --sdist .
twine check dist/*
- name: Test Documentation
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.11') }}
run: |
pip install .[docs]
cd docs
make html
cd ..
- name: Upload coverage
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.11') }}
uses: codecov/codecov-action@v4
with:
verbose: true # optional (default = false)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
distribute:
name: Distributing
needs: build-and-test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
PYTHON_VERSION: '3.11'
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Base Env
run: |
conda info
conda list
conda config --show
conda install --quiet --yes pip numpy scipy
- name: Install Our Package
run: |
pip install -v -e .[docs]
- name: Generate Source Distribution
run: |
pip install build twine
python -m build --sdist .
twine check dist/*
- name: Build Documentation
run: |
cd docs
make html
cd ..
- name: GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
build_dir: docs/_build/html
jekyll: false
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: pypi-publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true