-
Notifications
You must be signed in to change notification settings - Fork 33
142 lines (120 loc) · 5.02 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
name: TileDB Python CI
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
env:
# 11.7 necessary due to: https://github.com/actions/setup-python/issues/682#issuecomment-1604261330
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-12' && matrix.python-version == '3.8' && '11.7' || '11' }}
#MACOSX_DEPLOYMENT_TARGET: "10.11"
# On windows-2019 we are using the Visual Studio generator, which is multi-config and places the build artifacts in a subdirectory
steps:
- name: Checkout TileDB-Py `dev`
uses: actions/checkout@v3
# By default Visual Studio chooses the earliest installed toolset version
# for the main build and vcpkg chooses the latest. Force it to use the
# latest (14.39 currently).
- name: Setup MSVC toolset (VS 2022)
uses: TheMrMilchmann/setup-msvc-dev@v3
if: matrix.os == 'windows-latest'
with:
arch: x64
toolset: 14.39
- name: Install Ninja (VS 2022)
uses: seanmiddleditch/gha-setup-ninja@v4
if: matrix.os == 'windows-latest'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Print Python version
run: |
which python
which pip
python --version
- name: Print env
run: printenv
- name: Print pip debug info
run: pip debug --verbose
# Remove after upstream PR fully-deployed:
# - https://github.com/actions/runner-images/pull/7125
- name: "Install homebrew dependencies"
run: brew install pkg-config
if: matrix.os == 'macos-12'
- name: "Install dependencies"
run: python -m pip install --upgrade -r misc/requirements_ci.txt
- name: "Get TILEDB_VERSION"
run: echo "LIBTILEDB_VERSION=$(python setup.py get_tiledb_version | tail -n 1)" >> $GITHUB_ENV
- name: "Get LIBTILEDB_SHA"
run: echo "LIBTILEDB_SHA=$(git ls-remote https://github.com/TileDB-Inc/TileDB $LIBTILEDB_VERSION | cut -c1-7)" >> $GITHUB_ENV
- name: "Download TileDB From Zip And Build TileDB-Py (Windows)"
run: |
choco install wget --no-progress
if wget https://github.com/TileDB-Inc/TileDB/releases/download/$LIBTILEDB_VERSION/tiledb-windows-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.zip; then
mkdir libtiledb
unzip tiledb-windows-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.zip -d libtiledb
cp libtiledb/bin/tiledb.dll tiledb
python setup.py develop --tiledb=libtiledb
else
# Build from source as fallback
python setup.py build_ext --inplace
python setup.py develop
fi
env:
TILEDB_FORCE_ALL_DEPS: True
CMAKE_GENERATOR: "Ninja"
if: matrix.os == 'windows-latest'
- name: "Download TileDB From Tarball And Build TileDB-Py (macOS)"
run: |
set -xeo pipefail
if wget https://github.com/TileDB-Inc/TileDB/releases/download/$LIBTILEDB_VERSION/tiledb-macos-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz; then
mkdir libtiledb
sudo tar -vzxf tiledb-macos-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz -C libtiledb
python setup.py develop --tiledb=libtiledb
else
# Build from source as fallback
python setup.py build_ext --inplace
python setup.py develop
fi
if: matrix.os == 'macos-12'
- name: "Download TileDB From Tarball And Build TileDB-Py (Linux)"
run: |
set -xeo pipefail
if wget https://github.com/TileDB-Inc/TileDB/releases/download/$LIBTILEDB_VERSION/tiledb-linux-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz; then
mkdir libtiledb
sudo tar -vzxf tiledb-linux-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz -C libtiledb
python setup.py develop --tiledb=libtiledb
else
# Build from source as fallback
python setup.py build_ext --inplace
python setup.py develop
fi
if: matrix.os == 'ubuntu-latest'
- name: "Check build directory"
run: ls -Rl
- name: "Run tests"
run: pytest -vv --showlocals
- name: "Print log files (failed build only)"
run: |
set -xeo pipefail
# Display log files if the build failed
echo 'Dumping log files for failed build'
echo '----------------------------------'
for f in $(find build -name *.log);
do echo '------'
echo $f
echo '======'
cat $f
done;
if: failure()