forked from wbolster/plyvel
-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (133 loc) · 5.75 KB
/
tests.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
name: plyvel build
on:
# Triggers the workflow on push to the main branch
push:
branches: [CI]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools
pip install -r requirements-dev.txt
- name: Build sdist
run: python setup.py sdist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: ./dist/*.tar.gz
wheel:
name: Build ${{ matrix.os }}-${{ matrix.cibw.arch }} wheel
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
name: mac-intel
cibw:
arch: x86_64
build: "cp37-*"
- os: macos-latest
name: mac-arm
cibw:
arch: universal2
build: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
- os: ubuntu-latest
name: manylinux
cibw:
arch: "auto aarch64"
build: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
- os: windows-2019
name: win32
architecture: x86
cibw:
arch: x86
build: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
- os: windows-2019
name: win_amd64
architecture: x64
cibw:
arch: AMD64
build: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" #cp38*win_amd64 cp39*win_amd64"
env:
VCPKG_INCLUDE_PATH: "C:/vcpkg/installed/${{ matrix.architecture }}-windows/include"
VCPKG_LIB_PATH: "C:/vcpkg/installed/${{ matrix.architecture }}-windows/lib"
VCPKG_DLL_PATH: "C:/vcpkg/installed/${{ matrix.architecture }}-windows/bin"
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
# `CPLUS_INCLUDE_PATH` and `LIBRARY_PATH` for `setup.py` to link leveldb and snappy headers and libs in macOS
CIBW_ENVIRONMENT_MACOS: >
C_INCLUDE_PATH="/usr/local/include:$C_INCLUDE_PATH"
CPLUS_INCLUDE_PATH="/usr/local/include:$CPLUS_INCLUDE_PATH"
LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"
# [Path and environment variables for command-line builds](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160), for setuptools msvc compiler in windows
# `PATH`: `delvewheel` searches it for the location of DLL dependencies
# `INCLUDE` and `LIB`: `MSVC` env variables for `setup.py` to link leveldb and snappy headers and libs in windows
CIBW_ENVIRONMENT_WINDOWS: >
INCLUDE="C:/local/include;$INCLUDE"
LIB="C:/local/lib;$LIB"
PATH="C:/local/bin;$PATH"
CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ARCHS_WINDOWS: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_BEFORE_ALL_LINUX: "gcc -v && bash scripts/install-snappy.sh && bash scripts/install-leveldb.sh"
CIBW_BEFORE_ALL_MACOS: "clang -v && bash scripts/install-snappy.sh && bash scripts/install-leveldb.sh"
# CIBW_BEFORE_ALL_WINDOWS: "vcpkg install leveldb:${{ matrix.architecture }}-windows"
# Install `delvewheel` on windows, because `cibuildwheel` doesn't yet ship a default repair command for Windows.
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --lib-sdir . -w {dest_dir} {wheel}"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} {wheel} -v"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel} -v"
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: "pytest -v {package}/test"
# Build using the manylinux2014 image instead of manylinux2010
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# CIBW_MANYLINUX_I686_IMAGE: manylinux2014
# CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: ${{ matrix.architecture }}
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
# From 10/23/2019, GitHub Actions default shell on Windows runners is changing to `PowerShell`
# However, cibuildwheel still use `CMD` instead of `PowerShell`, test by using "(dir 2>&1 *`|echo CMD);&<# rem #>echo PowerShell" in
# such `CIBW_BEFORE_ALL_WINDOWS`
# vcpkg install leveldb:${{ matrix.architecture }}-windows
- name: Install windows dependencies
if: runner.os == 'Windows'
run: |
echo "We are in shell:"; echo(dir 2>&1 *`|echo CMD);&<# rem #>echo PowerShell
PowerShell scripts/install-snappy.ps1
PowerShell scripts/install-leveldb.ps1
echo "Find leveldb in:"
If ((test-path "C:\local\include")) { (dir "C:\local\include") }
If ((test-path "C:\local\lib")) { (dir "C:\local\lib") }
If ((test-path "C:\local\bin")) { (dir "C:\local\bin") }
- name: Install cibuildwheel
run: |
pip install -U setuptools pip wheel
pip install -U cibuildwheel
- name: Build
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl