-
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (100 loc) · 2.85 KB
/
tests.yml
File metadata and controls
113 lines (100 loc) · 2.85 KB
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
name: Run Tests
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
- develop
tags:
- 'v*'
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
permissions:
contents: read
env:
ZIG_VERSION: 0.16.0
DUCKDB_VERSION: v1.5.2
jobs:
native-tests:
name: Native Tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux AMD64
os: ubuntu-latest
platform: linux_amd64
duckdb_asset: duckdb_cli-linux-amd64.zip
duckdb_exec: ./duckdb
- name: macOS ARM64
os: macos-14
platform: osx_arm64
duckdb_asset: duckdb_cli-osx-universal.zip
duckdb_exec: ./duckdb
- name: Windows AMD64
os: windows-latest
platform: windows_amd64
duckdb_asset: duckdb_cli-windows-amd64.zip
duckdb_exec: ./duckdb.exe
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Build Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y unzip
- name: Download DuckDB CLI
shell: bash
run: |
curl -L -o duckdb.zip "https://github.com/duckdb/duckdb/releases/download/${{ env.DUCKDB_VERSION }}/${{ matrix.duckdb_asset }}"
unzip -q duckdb.zip
chmod +x duckdb 2>/dev/null || true
- name: Run Unit, Property, and Integration Tests
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
DUCKDB_PATH="$(pwd -W)/duckdb.exe"
else
DUCKDB_PATH="$PWD/duckdb"
fi
zig build test \
-Dextension-name=vizier \
-Dapi-version=v1.2.0 \
-Dplatform=${{ matrix.platform }} \
-Dduckdb-path="$DUCKDB_PATH" \
--summary all
- name: Run SQL Tests
shell: bash
run: |
fail=0
for f in tests/sql/*.sql; do
name=$(basename "$f")
if ${{ matrix.duckdb_exec }} -unsigned -c ".read $f" > /dev/null 2>&1; then
printf " %-40s PASS\n" "$name"
else
printf " %-40s FAIL\n" "$name"
fail=1
fi
done
[ "$fail" -eq 0 ] && echo "All SQL tests passed." || (echo "Some SQL tests failed." && exit 1)