-
Notifications
You must be signed in to change notification settings - Fork 15
143 lines (140 loc) · 5.13 KB
/
test.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
name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
download-minio:
runs-on: ubuntu-latest
steps:
- name: "Download MinIO"
run: |
mkdir -p ./minio
curl -sS -L \
https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z -o ./minio/minio-linux \
https://dl.min.io/server/minio/release/darwin-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z -o ./minio/minio-darwin \
https://dl.min.io/server/minio/release/windows-amd64/archive/minio.RELEASE.2023-07-21T21-12-44Z -o ./minio/minio-windows.exe
- name: "Save MinIO"
uses: actions/upload-artifact@v3
with:
name: minio
path: ./minio/*
# We want older SQLite amalgamation files, but they are not available to download,
# so must be built from source. And they cannot be build on Windows, even for tests
# that then compile the amalgamation on Windows
create-sqlite-amalgamation:
name: "Create SQLite amalgamation"
runs-on: ubuntu-latest
strategy:
matrix:
sqlite-url-version:
- {version: "3042000", url: "https://www.sqlite.org/src/tarball/831d0fb2/SQLite-831d0fb2.tar.gz"}
- {version: "3036000", url: "https://www.sqlite.org/src/tarball/5c9a6c06/SQLite-5c9a6c06.tar.gz"}
- {version: "3007015", url: "https://www.sqlite.org/src/tarball/cd0b37c5/SQLite-cd0b37c5.tar.gz"}
steps:
- name: "Download SQLite source and build amalgamation"
run: |
curl -sS -L '${{ matrix.sqlite-url-version.url }}' -o sqlite3.tar.gz
mkdir sqlite3
tar -zxvf sqlite3.tar.gz --strip-components=1 -C sqlite3
cd sqlite3
./configure
make sqlite3.c
- name: "Save SQLite amalgamation"
uses: actions/upload-artifact@v3
with:
name: sqlite-${{ matrix.sqlite-url-version.version }}
path: ./sqlite3/sqlite3.c
test:
name: Test
needs: [download-minio, create-sqlite-amalgamation]
strategy:
matrix:
# If changing how many times tests are run, must also change in codecov.yml
# to ensure test coverage is reported only after all tests have finished
os:
- "macos-11"
- "ubuntu-20.04"
- "windows-2019"
sqlite-version:
- "3042000"
- "3036000"
- "3007015"
- "default"
python-version:
- "3.6.7"
- "3.7.1"
- "3.8.0"
- "3.9.0"
- "3.10.0"
- "3.11.0"
package-extras:
- "ci-earliest"
- "ci-latest"
exclude:
- python-version: "3.6.7"
package-extras: "ci-latest"
runs-on: '${{ matrix.os }}'
env:
SQLITE3_VERSION: ${{ matrix.sqlite-version }}
MINIO_ROOT_USER: AKIAIOSFODNN7EXAMPLE
MINIO_ROOT_PASSWORD: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
MINIO_REGION: us-east-1
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: '${{ matrix.python-version }}'
- name: "Load MinIO"
uses: actions/download-artifact@v3
with:
name: minio
path: ./minio
- name: "Load SQLite amalgamation"
if: matrix.sqlite-version != 'default'
uses: actions/download-artifact@v3
with:
name: sqlite-${{ matrix.sqlite-version }}
path: .
- name: "Compile SQLite from amalgamation (Windows)"
if: matrix.os == 'windows-2019' && matrix.sqlite-version != 'default'
run: |
gcc -shared sqlite3.c -o sqlite3.dll
echo "LIBSQLITE3_PATH=${PWD}/sqlite3.dll" >> $env:GITHUB_ENV
- name: "Compile SQLite from amalgamation (Ubuntu or macOS)"
if: (matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-11') && matrix.sqlite-version != 'default'
run: |
gcc -shared -fPIC -o libsqlite3.so.0 sqlite3.c
echo "LIBSQLITE3_PATH=${PWD}/libsqlite3.so.0" >> "$GITHUB_ENV"
- name: "Install sqlite-s3-query and any dependencies"
run: |
pip install ".[dev,${{ matrix.package-extras }}]"
- name: "Test (Windows)"
if: matrix.os == 'windows-2019'
run: |
mkdir -p ./data
./minio/minio-windows.exe server ./data &
do {
Write-Host "Waiting for MinIO"
sleep 3
} until(Test-NetConnection 127.0.0.1 -Port 9000 | ? { $_.TcpTestSucceeded } )
coverage run -m unittest
- name: "Test (Ubuntu)"
if: matrix.os == 'ubuntu-20.04'
run: |
mkdir -p ./data
chmod +x ./minio/minio-linux
./minio/minio-linux server ./data &
until nc -w 10 127.0.0.1 9000; do sleep 1; done
coverage run -m unittest
- name: "Test (macOS)"
if: matrix.os == 'macos-11'
run: |
mkdir -p ./data
chmod +x ./minio/minio-darwin
./minio/minio-darwin server ./data &
until nc -w 10 127.0.0.1 9000; do sleep 1; done
coverage run -m unittest
- uses: codecov/codecov-action@v3