-
-
Notifications
You must be signed in to change notification settings - Fork 63
198 lines (188 loc) · 6.49 KB
/
pull_request_test.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
name: Pull Request Test
on:
pull_request:
branches:
- main
jobs:
build_manylinux:
name: Build for manylinux
runs-on: ubuntu-latest
container:
image: docker://quay.io/pypa/manylinux2014_x86_64
strategy:
max-parallel: 4
matrix:
cp: [cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
steps:
- uses: actions/checkout@v1
- name: Print Info
run: |
cat /proc/cpuinfo
- name: Install dependencies
run: |
git clone https://gitlab.com/libeigen/eigen
cd eigen
git checkout tags/3.4.0
cd ..
mv eigen include
git clone https://github.com/bab2min/EigenRand
cd EigenRand
git checkout tags/v0.4.1
cd ..
mv EigenRand/EigenRand include/
git clone https://github.com/mapbox/variant
cd variant
git checkout tags/v1.1.3
cd ..
mv variant/include/mapbox include/
- name: Build
run: |
/opt/python/${{ matrix.cp }}/bin/python -m pip install numpy==`/opt/python/${{ matrix.cp }}/bin/python .github/workflows/numpy_version.py`
/opt/python/${{ matrix.cp }}/bin/python setup.py build install
- run: tar -zcvf build.tgz build
- name: Archive binary
uses: actions/upload-artifact@v1
with:
name: Linux Binary ${{ matrix.cp }}
path: build.tgz
- name: Test
continue-on-error: True
run: |
/opt/python/${{ matrix.cp }}/bin/python -m pip install pytest nltk
/opt/python/${{ matrix.cp }}/bin/python -m nltk.downloader stopwords
/opt/python/${{ matrix.cp }}/bin/python -m pytest --verbose -s test/unit_test.py
build_linux_arm64:
name: Arm64-Centos7
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
cp: [cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
steps:
- uses: actions/checkout@v2
with:
submodules: true
lfs: true
- uses: bab2min/run-on-arch-action@use-custom-image
id: runcmd
with:
image: quay.io/pypa/manylinux2014_aarch64
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/artifacts"
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
run: |
git clone https://gitlab.com/libeigen/eigen
cd eigen
git checkout tags/3.4.0
cd ..
mv eigen include
git clone https://github.com/bab2min/EigenRand
cd EigenRand
git checkout tags/v0.4.1
cd ..
mv EigenRand/EigenRand include/
git clone https://github.com/mapbox/variant
cd variant
git checkout tags/v1.1.3
cd ..
mv variant/include/mapbox include/
/opt/python/${{ matrix.cp }}/bin/python -m pip install numpy==`/opt/python/${{ matrix.cp }}/bin/python .github/workflows/numpy_version.py`
/opt/python/${{ matrix.cp }}/bin/python setup.py build install
tar -zcvf /artifacts/build.tgz build
- name: Archive binaries
uses: actions/upload-artifact@v1
with:
name: Artifacts ${{ matrix.cp }}
path: artifacts/build.tgz
build_macos_13:
name: Build for macOS 13
runs-on: macOS-13
strategy:
max-parallel: 4
matrix:
python-version: [3.9, "3.10", 3.11, 3.12]
cpu-arch: ["x86_64", "arm64"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
tar -zxvf eigen-3.4.0.tar.gz
rm eigen-3.4.0.tar.gz
mv eigen-* include
wget https://github.com/bab2min/EigenRand/archive/v0.4.1.tar.gz
tar -zxvf v0.4.1.tar.gz
mv EigenRand-0.4.1/EigenRand include/
wget https://github.com/mapbox/variant/archive/v1.1.3.tar.gz
tar -zxvf v1.1.3.tar.gz
mv variant-1.1.3/include/mapbox include/
- name: Build
run: |
export AUDITWHEEL_PLAT=many
export MACOSX_DEPLOYMENT_TARGET=10.14
python -m pip install numpy==`python .github/workflows/numpy_version.py`
TOMOTOPY_CPU_ARCH=${{ matrix.cpu-arch }} python setup.py build install
- name: Archive binary
uses: actions/upload-artifact@v2
with:
name: macOS Binary ${{ matrix.python-version }} ${{ matrix.cpu-arch }}
path: |
build/*
- name: Test
if: ${{ matrix.cpu-arch == 'x86_64' }}
run: |
python -m pip install pytest nltk
python -m nltk.downloader stopwords
python -m pytest --verbose -s test/unit_test.py
build_windows:
name: Build for Windows
runs-on: windows-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9, "3.10", 3.11, 3.12]
architecture: [x86, x64]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
Invoke-WebRequest -OutFile eigen-3.4.0.tar.gz https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
tar -zxvf eigen-3.4.0.tar.gz
rm eigen-3.4.0.tar.gz
mv eigen-* include
Invoke-WebRequest -OutFile v0.4.1.tar.gz https://github.com/bab2min/EigenRand/archive/v0.4.1.tar.gz
tar -zxvf v0.4.1.tar.gz
mv EigenRand-0.4.1/EigenRand include/
Invoke-WebRequest -OutFile v1.1.3.tar.gz https://github.com/mapbox/variant/archive/v1.1.3.tar.gz
tar -zxvf v1.1.3.tar.gz
mv variant-1.1.3/include/mapbox include/
- name: Build
run: |
python -m pip install numpy==$(python .github/workflows/numpy_version.py)
python setup.py build install
- name: Archive binary
uses: actions/upload-artifact@v2
with:
name: pyd ${{ matrix.python-version }} ${{ matrix.architecture }}
path: |
build/**/*.pyd
build/**/*.pdb
- name: Test
run: |
python -m pip install pytest nltk
python -m nltk.downloader stopwords
python -m pytest --verbose -s test/unit_test.py