forked from piskvorky/gensim
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (115 loc) · 4.01 KB
/
build-wheels.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
name: Build wheels
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '0 0 * * sun,wed'
jobs:
linters:
uses: ./.github/workflows/linters.yml
build_wheels:
needs: linters
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_WINDOWS: AMD64 x86
CIBW_SKIP: pp* cp36-* cp37-* *-win32 *_i686 *-musllinux_*
CIBW_TEST_COMMAND: pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
CIBW_TEST_REQUIRES: pytest testfixtures mock
CIBW_TEST_SKIP: cp38* cp39* cp310* *_aarch64 *_arm64 *_universal2
CIBW_BUILD_VERBOSITY: 3
- name: Upload wheels as artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
test:
name: Test wheel for ${{ matrix.os }} Python ${{ matrix.python }}
needs: build_wheels
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
python: ['3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Downloads build artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/
#
# We want to make sure our wheels run against older Numpy versions
#
- name: Install oldest-supported-numpy
run: python -m pip install oldest-supported-numpy
#
# Avoid checking out the entire gensim repo to get just one file
#
- name: Download installwheel.py
run: curl "https://raw.githubusercontent.com/RaRe-Technologies/gensim/testwheel/.github/workflows/installwheel.py" --output installwheel.py --silent
- name: Install wheel
run: python installwheel.py artifacts/wheels-${{ matrix.os }}
- name: Debug test environment
run: |
pip freeze
python -c 'import numpy;print(numpy.__file__)'
python -c 'import numpy;print(numpy.__version__)'
#
# If the wheel was incorrectly built, then this will fail.
# https://github.com/RaRe-Technologies/gensim/issues/3097
#
- name: Test wheel
run: python -c 'import gensim'
upload:
name: Upload to S3
if: always()
needs: build_wheels
runs-on: ubuntu-latest
steps:
- name: Install wheel uploading tool
run: python -m pip install wheelhouse-uploader
- name: Downloads build artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/
- name: Check files
run: tree artifacts/
- name: Move all wheels into one folder
run: mkdir wheelhouse ; find artifacts/ -name '*.whl' -exec mv -v {} wheelhouse/ \;
- name: Upload wheels to s3://gensim-wheels
#
# Only do this if the credentials are set.
# This means that PRs will still build wheels, but not upload them.
# (PRs do not have access to secrets).
#
if: ${{ env.WHEELHOUSE_UPLOADER_USERNAME && env.WHEELHOUSE_UPLOADER_SECRET }}
run: python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
env:
WHEELHOUSE_UPLOADER_USERNAME: ${{ secrets.AWS_ACCESS_KEY_ID }}
WHEELHOUSE_UPLOADER_SECRET: ${{ secrets.AWS_SECRET_ACCESS_KEY }}