-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (134 loc) · 4.17 KB
/
ci.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
146
name: CI
on:
push:
branches: [ main ]
tags: [ 'v[0-9]+\.[0-9]+.*' ]
pull_request: { branches: [main] }
workflow_call:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: pre-commit/action@v2.0.0
test1:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
env:
TEST_WITH_COVERAGE: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }}
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
pip install -U pip wheel
pip install .
pip install .[dev,plots]
python -c 'import skopt; print(skopt.__version__)'
- name: Run tests
if: env.TEST_WITH_COVERAGE != 'true'
run: pytest
- name: Test with Coverage
if: env.TEST_WITH_COVERAGE == 'true'
run: |
make test-coverage
- name: Upload coverage reports to Codecov
if: env.TEST_WITH_COVERAGE == 'true'
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: holgern/scikit-optimize
- name: Build package
if: env.TEST_WITH_COVERAGE == 'true'
run: |
pip install --upgrade build
python -m build --sdist --wheel --outdir dist/
- name: Upload artifact
if: env.TEST_WITH_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: package
path: dist
test2:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
scikit-learn-version: ["1.5.0", "1.3.2", "1.2.2", "1.1.3", "1.0.2"]
numpy-version: ["1.20.3", "1.22.4","1.24.4", "1.26.4"]
exclude:
- python-version: "3.8"
scikit-learn-version: "1.5.0"
- python-version: "3.8"
numpy-version: "1.26.4"
- python-version: "3.11"
scikit-learn-version: "1.0.2"
- python-version: "3.11"
scikit-learn-version: "1.1.3"
- python-version: "3.10"
numpy-version: "1.20.3"
- python-version: "3.11"
numpy-version: "1.20.3"
- python-version: "3.11"
numpy-version: "1.22.4"
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
pip install -U pip wheel
pip install numpy==${{ matrix.numpy-version }}
pip install scikit-learn==${{ matrix.scikit-learn-version }}
pip install .
pip install .[dev,plots]
python -c 'import skopt; print(skopt.__version__)'
- name: Run tests
run: pytest
doctest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install packages
run: |
pip install -U pip wheel
pip install .
pip install .[dev,plots,doc]
python -c 'import skopt; print(skopt.__version__)'
- name: Install latex dependencies
run: |
sudo apt-get -yq update
sudo apt-get -yq --no-install-recommends install \
dvipng texlive-latex-base texlive-latex-extra \
texlive-latex-recommended texlive-fonts-recommended \
latexmk tex-gyre gsfonts ccache
- name: Test docs
run: |
python -c 'import skopt; skopt.show_versions()'
make test-doc
make test-sphinxext
make -C doc doctest
make -C doc linkcheck
- name: Build docs
run: |
.github/scripts/build_docs.sh
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: doc/_build/html/stable