-
Notifications
You must be signed in to change notification settings - Fork 1
203 lines (173 loc) · 5.98 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
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
name: Continuous Integration
on:
push:
branches:
- main
tags:
- "*"
pull_request:
schedule:
- cron: '30 2 * * 1,4' # Every Monday and Thursday @ 2h30am UTC
env:
VCPKG_INSTALLED_DIR: /tmp/vcpkg_installed
VCPKG_TARGET_TRIPLET: x64-linux-dynamic-cxx17-abi1-rel
ARTIFACT_NAME: distribution
jobs:
build-sdist:
name: Build Source Distribution
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
python: ["3.8"]
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip and install build
run: python -m pip install -U pip build
- name: Checkout source
uses: actions/checkout@v4
- name: Build source distribution
run: python -m build --sdist
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ./dist/*.tar.gz
cpp-tests:
name: Execute C++ test cases
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: List directory structure
run: tree
- name: Install C++ Compiler and cmake
run: |
sudo apt update
sudo apt install build-essential cmake
python -m pip install -U pip
python -m pip install pyarrow
- name: Get Github Action Cache Variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Build C++ libraries and tests
env:
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
VCPKG_TARGET_TRIPLET: ${{ env.VCPKG_TARGET_TRIPLET }}
run: |
cmake -S . -B build
cmake --build build
- name: Execute C++ tests
run: |
cd build
ctest --verbose
# - name: Debug with tmate on failure
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
build-wheels:
name: Build and Test Binary Wheels
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
fail-fast: false
matrix:
# https://peps.python.org/pep-0425
python:
# python version, cpython tag
- ["3.8", "cp38"]
- ["3.9", "cp39"]
- ["3.10", "cp310"]
- ["3.11", "cp311"]
steps:
- name: Set up Python ${{ matrix.python[0] }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python[0] }}
- name: Upgrade pip and install virtualenv
run: python -m pip install -U pip virtualenv
- name: Checkout source
uses: actions/checkout@v4
- name: Get Github Action Cache Variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run cibuildwheel
uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: ${{ matrix.python[1] }}-manylinux_x86_64
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_ALL_LINUX: yum install -y zip flex bison gcc-gfortran
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_ENVIRONMENT_LINUX: >
CMAKE_ARGS=-DBUILD_TESTING=OFF
ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
VCPKG_BINARY_SOURCES="clear;x-gha,readwrite"
VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TARGET_TRIPLET }}
VCPKG_INSTALLED_DIR=${{ env.VCPKG_INSTALLED_DIR }}
LD_LIBRARY_PATH=${{ env.VCPKG_INSTALLED_DIR }}/${{ env.VCPKG_TARGET_TRIPLET }}/lib
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair -w {dest_dir} {wheel} --exclude libarrow_python.so --exclude libarrow.so.1400
CIBW_TEST_EXTRAS: applications,test
CIBW_TEST_COMMAND: py.test -s -vvv --pyargs arcae
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ./wheelhouse/*.whl
upload-to-test-pypi:
name: Upload release to Test PyPI
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
environment:
name: release-test
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: dist
- name: List artifacts
run: ls -lh dist
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
continue-on-error: true
upload-to-pypi:
name: Upload release to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: dist
- name: List artifacts
run: ls -lh dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1