-
Notifications
You must be signed in to change notification settings - Fork 2
227 lines (188 loc) · 5.96 KB
/
rac-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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Build
on:
push:
branches:
- newbranch
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Make linux script executable
if: runner.os == 'Linux'
run: chmod +x ./dependencies_linux.sh
- name: Make mac script executable
if: runner.os == 'macOS'
run: chmod +x ./dependencies_mac.sh
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install scikit-build
pip install cibuildwheel
- name: Install pybind for windows
if: runner.os == 'Windows'
run: pip install pybind11
- name: Set Python path for windows
if: runner.os == 'Windows'
run: echo "PPATH=$(which python)" >> $GITHUB_ENV
- name: Run Windows dependencies script
if: runner.os == 'Windows'
shell: powershell
run: .\dependencies_windows.ps1
- name: Set mac environment variables
if: runner.os == 'macOS'
run: |
echo "CC=$(which clang)" >> $GITHUB_ENV
echo "CXX=$(which clang++)" >> $GITHUB_ENV
echo "OpenMP_LIBRARY=/usr/local/lib/libomp.dylib" >> $GITHUB_ENV
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "pp*"
CIBW_ENVIRONMENT_WINDOWS: PPATH=${{ env.PPATH }}
- uses: actions/upload-artifact@v2
with:
name: wheelhouse
path: ./wheelhouse/*.whl
test_linux:
name: Test on Linux
runs-on: ubuntu-latest
needs: build_wheels
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install numpy
pip install scikit-learn
pip install scipy
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: wheelhouse
path: dist
- name: Install linux wheels
run: |
PLATFORM=$(uname -m)
PYTHON_VERSION=$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)
WHEEL_FILE=$(ls dist/racplusplus*cp${PYTHON_VERSION//.}*manylinux*${PLATFORM}.whl)
echo "Installing ${WHEEL_FILE}"
pip install "${WHEEL_FILE}"
- name: Run tests
run: |
cd pytest
pytest
test_macos:
name: Test on MacOS
runs-on: macos-latest
needs: build_wheels
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install numpy
pip install scikit-learn
pip install scipy
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: wheelhouse
path: dist
- name: Install mac wheels
run: |
PLATFORM=$(uname -m)
PYTHON_VERSION=$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)
WHEEL_FILE=$(ls dist/racplusplus*cp${PYTHON_VERSION//.}*macosx*${PLATFORM}.whl)
echo "Installing ${WHEEL_FILE}"
pip install "${WHEEL_FILE}"
- name: Run tests
run: |
cd pytest
pytest
test_windows:
name: Test on Windows
runs-on: windows-latest
needs: build_wheels
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install numpy
pip install scikit-learn
pip install scipy
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: wheelhouse
path: dist
- name: Install windows wheels
run: |
PLATFORM=$(uname -m)
PYTHON_VERSION=$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)
WHEEL_FILE=$(ls dist/racplusplus*cp${PYTHON_VERSION//.}*win_amd64.whl)
echo "Installing ${WHEEL_FILE}"
pip install "${WHEEL_FILE}"
shell: bash
- name: Run tests
run: |
cd pytest
pytest
upload_to_pypi:
needs: [build_wheels, test_linux, test_macos, test_windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(grep version pyproject.toml | head -n 1 | sed 's/version = "\(.*\)"/\1/')
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Install upload dependencies
run: python -m pip install twine
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: wheelhouse
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}