32
32
# - cron: '15 0 * * *'
33
33
pull_request :
34
34
paths :
35
- - ' velox/**'
36
- - ' !velox/docs/**'
37
- - ' third_party/**'
38
- - ' pyvelox/**'
39
35
- ' .github/workflows/build_pyvelox.yml'
40
36
41
37
permissions :
@@ -46,23 +42,22 @@ concurrency:
46
42
cancel-in-progress : true
47
43
48
44
jobs :
49
- # TODO: https://github.com/facebookincubator/velox/issues/9014
50
- if : false
51
45
build_wheels :
52
46
name : Build wheels on ${{ matrix.os }}
53
47
runs-on : ${{ matrix.os }}
54
48
strategy :
55
49
fail-fast : false
56
50
matrix :
57
- os : [ubuntu-22.04 ]
51
+ os : [8-core- ubuntu, macos-13, macos-14 ]
58
52
steps :
59
- - uses : actions/checkout@v3
53
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60
54
with :
61
55
ref : ${{ inputs.ref || github.ref }}
62
56
fetch-depth : 0
63
57
submodules : recursive
58
+ persist-credentials : false
64
59
65
- - uses : actions/setup-python@v4
60
+ - uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
66
61
with :
67
62
python-version : ' 3.10'
68
63
@@ -90,76 +85,87 @@ jobs:
90
85
# NEXT_VERSION=$(echo $VERSION | awk -F. -v OFS=. '{$NF++ ; print}')
91
86
echo "build_version=${VERSION}a${COMMITS_SINCE_TAG}" >> $GITHUB_OUTPUT
92
87
93
- - run : mkdir -p ccache
94
88
- name : " Restore ccache"
95
- uses : actions/cache/restore@v3
89
+ # CCache doesn't hit in cibuildwheel
90
+ if : startsWith(matrix.os, 'macos')
91
+ uses : apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
96
92
id : restore-cache
97
93
with :
98
94
path : " ccache"
99
- key : ccache-wheels-${{ matrix.os }}-${{ github.sha }}
100
- restore-keys : |
101
- ccache-wheels-${{ matrix.os }}-
95
+ key : ccache-wheels-${{ matrix.os }}
96
+
97
+ - name : " Restore macOS Dependencies"
98
+ if : startsWith(matrix.os, 'macos')
99
+ uses : apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4
100
+ id : restore-deps
101
+ with :
102
+ path : " dependencies"
103
+ key : dependencies-pyvelox-${{ matrix.os }}-${{ hashFiles('scripts/setup-macos.sh') }}
102
104
103
105
- name : Install macOS dependencies
104
- if : matrix.os == 'macos-11'
106
+ if : ${{ startsWith(matrix.os, 'macos') && steps.restore-deps.outputs.stash-hit != 'true' }}
107
+ env :
108
+ MACOSX_DEPLOYMENT_TARGET : " 13.0"
105
109
run : |
106
- echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1/" >> $GITHUB_ENV
107
- bash scripts/setup-macos.sh &&
108
- bash scripts/setup-macos.sh install_folly
110
+ export INSTALL_PREFIX="$GITHUB_WORKSPACE/dependencies"
111
+ echo "CMAKE_PREFIX_PATH=$INSTALL_PREFIX" >> $GITHUB_ENV
112
+ echo "DYLD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
113
+ bash scripts/setup-macos.sh
114
+
115
+ - name : " Save macOS Dependencies"
116
+ if : ${{ startsWith(matrix.os, 'macos') && steps.restore-deps.outputs.stash-hit != 'true' }}
117
+ uses : apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4
118
+ with :
119
+ path : " dependencies"
120
+ key : dependencies-pyvelox-${{ matrix.os }}-${{ hashFiles('scripts/setup-macos.sh') }}
121
+ retention-days : 90
109
122
110
123
- name : " Create sdist"
111
- if : matrix.os == 'ubuntu-22.04 '
124
+ if : matrix.os == '8-core-ubuntu '
112
125
env :
113
126
BUILD_VERSION : " ${{ inputs.version || steps.version.outputs.build_version }}"
114
127
run : |
115
128
python setup.py sdist --dist-dir wheelhouse
116
129
117
130
- name : Build wheels
118
- uses : pypa/cibuildwheel@v2.22.0
131
+ uses : pypa/cibuildwheel@6cccd09a31908ffd175b012fb8bf4e1dbda3bc6c # v2
119
132
env :
120
- # required for preadv/pwritev
121
- MACOSX_DEPLOYMENT_TARGET : " 11.0"
122
- CIBW_ARCHS : " x86_64"
123
- # On PRs only build for Python 3.7
124
- CIBW_BUILD : ${{ github.event_name == 'pull_request' && 'cp37-*' || 'cp3*' }}
133
+ MACOSX_DEPLOYMENT_TARGET : ${{ matrix.os == 'macos-14' && '14' || '13' }}
134
+ CIBW_ARCHS : " native"
135
+ # Only build for 3.12 for now
136
+ CIBW_BUILD : ${{ github.event_name == 'pull_request' && 'cp312-*' || 'cp312-*' }}
125
137
CIBW_SKIP : " *musllinux* cp36-*"
126
- CIBW_MANYLINUX_X86_64_IMAGE : " ghcr.io/facebookincubator/velox-dev:torcharrow-avx"
127
- CIBW_BEFORE_ALL_LINUX : >
128
- mkdir -p /output &&
129
- cp -R /host${{ github.workspace }}/ccache /output/ccache &&
130
- ccache -s
131
- CIBW_ENVIRONMENT_PASS_LINUX : CCACHE_DIR BUILD_VERSION
138
+ CIBW_MANYLINUX_X86_64_IMAGE : " ghcr.io/facebookincubator/velox-dev:pyvelox"
139
+ CIBW_ENVIRONMENT_PASS_LINUX : " BUILD_VERSION"
140
+ # Don't waste time writing out to cache
141
+ CIBW_ENVIRONMENT_LINUX : " CCACHE_DISABLE=true"
132
142
CIBW_TEST_EXTRAS : " tests"
133
143
CIBW_TEST_COMMAND : " cd {project}/pyvelox && python -m unittest -v"
134
- CIBW_TEST_SKIP : " *macos* "
135
- CCACHE_DIR : " ${{ matrix.os != 'macos-11' && '/output' || github.workspace }}/ccache"
144
+ CIBW_TEST_SKIP : " *"
145
+ CCACHE_DIR : " ${{ github.workspace }}/ccache"
136
146
BUILD_VERSION : " ${{ inputs.version || steps.version.outputs.build_version }}"
137
147
with :
138
148
output-dir : wheelhouse
139
149
140
- - name : " Move ccache to workspace"
141
- if : matrix.os != 'macos-11'
142
- run : |
143
- mkdir -p ccache
144
- cp -R ./wheelhouse/ccache/* ccache
145
-
146
150
- name : " Save ccache"
147
- uses : actions/cache/save@v3
148
- id : cache
151
+ # CCache doesn't hit in cibuildwheel
152
+ if : startsWith(matrix.os, 'macos')
153
+ uses : apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4
149
154
with :
150
155
path : " ccache"
151
- key : ccache-wheels-${{ matrix.os }}-${{ github.sha }}
156
+ key : ccache-wheels-${{ matrix.os }}
152
157
153
158
- name : " Rename wheel compatibility tag"
154
- if : matrix.os == 'macos-11'
159
+ if : false # startsWith( matrix.os, 'macos')
155
160
run : |
156
161
brew install rename
157
162
cd wheelhouse
158
163
rename 's/11_0/10_15/g' *.whl
159
164
160
- - uses : actions/upload-artifact@v4
165
+ - uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
161
166
with :
162
- name : wheels
167
+ name : wheels-${{ matrix.os }}
168
+ retention-days : 5
163
169
path : |
164
170
./wheelhouse/*.whl
165
171
./wheelhouse/*.tar.gz
@@ -170,19 +176,20 @@ jobs:
170
176
needs : build_wheels
171
177
runs-on : ubuntu-22.04
172
178
steps :
173
- - uses : actions/download-artifact@v4
179
+ - uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
174
180
with :
175
- name : wheels
181
+ pattern : wheels-*
182
+ merge-multiple : true
176
183
path : ./wheelhouse
177
184
178
185
- run : ls wheelhouse
179
186
180
- - uses : actions/setup-python@v3
187
+ - uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
181
188
with :
182
189
python-version : " 3.10"
183
190
184
191
- name : Publish a Python distribution to PyPI
185
- uses : pypa/gh-action-pypi-publish@v1.12.3
192
+ uses : pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
186
193
with :
187
194
password : ${{ secrets.PYPI_API_TOKEN }}
188
195
packages_dir : wheelhouse
0 commit comments