forked from scikit-optimize/scikit-optimize
-
Notifications
You must be signed in to change notification settings - Fork 6
138 lines (120 loc) · 3.68 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
name: CI
on:
push:
branches: [ master, main, ci/* ]
tags: [ 'v[0-9]+\.[0-9]+.*' ]
pull_request: { branches: [master] }
schedule: [ cron: '20 16 * * 6' ]
workflow_call:
# Disallow parallel runs
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}"
cancel-in-progress: true
jobs:
lint:
# Disable liniting for now
if: false
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
name: Set up caches
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 3
- name: Install dependencies
run: pip install flake8
- name: flake8
run: flake8 skopt/
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# When bumping, note to revise env.TEST_WITH_COVERAGE below
os: [ "ubuntu-20.04", "ubuntu-22.04", "macos-latest", "windows-latest" ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
scikit-version: [ "1.1.3", "1.2.2", "1.3.2" ]
env:
TEST_WITH_COVERAGE: ${{ matrix.python-version == '3.11' && matrix.scikit-version == '1.3.2' && matrix.os == 'ubuntu-22.04' }}
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install -U pip wheel
pip install scikit-learn==${{ matrix.scikit-version }}
pip install .
pip install .[dev,plots]
python -c 'import skopt; print(skopt.__version__)'
- name: Test
if: env.TEST_WITH_COVERAGE != 'true'
run: |
make test-code-parallel
- name: Test with Coverage
if: env.TEST_WITH_COVERAGE == 'true'
run: |
make test-coverage
bash <(curl -s https://codecov.io/bash)
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: package
path: dist
docs:
name: Docs
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
env:
MPLBACKEND: "agg"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repo
uses: actions/checkout@v4
- 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: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install .[dev,doc,plots]
- 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