-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (123 loc) · 5.06 KB
/
Copy pathci.yml
File metadata and controls
144 lines (123 loc) · 5.06 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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '17 3 * * 1'
jobs:
build-and-test:
if: github.event_name != 'schedule'
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
compiler: [g++, clang++]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build and test
env:
CXX: ${{ matrix.compiler }}
run: make -f Makefile clean && make -f Makefile all
macos:
if: github.event_name != 'schedule'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install mysql-client postgresql zstd
echo "/opt/homebrew/opt/mysql-client/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/zstd/bin" >> $GITHUB_PATH
- name: Build and test
env:
LIBRARY_PATH: "/opt/homebrew/lib"
run: make -f Makefile clean && make -f Makefile all MYSQL_CFLAGS="-I/opt/homebrew/opt/mysql-client/include"
benchmark:
if: github.event_name != 'schedule'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build release and run benchmarks
run: |
sed 's/-g -O2/-O3/' Makefile > /tmp/Makefile.release
make -f /tmp/Makefile.release clean
make -f /tmp/Makefile.release lib
make -f /tmp/Makefile.release test
make -f /tmp/Makefile.release bench 2>&1 | tail -20
./run_bench --benchmark_format=json > benchmark_results.json 2>/dev/null
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark_results.json
corpus-test:
if: github.event_name != 'schedule'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build
run: make -f Makefile all && make -f Makefile build-corpus-test
- name: Test against SQLGlot
run: |
git clone --depth 1 -q https://github.com/tobymao/sqlglot.git /tmp/sqlglot
cat /tmp/sqlglot/tests/fixtures/identity.sql /tmp/sqlglot/tests/fixtures/tpch.sql \
/tmp/sqlglot/tests/fixtures/tpcds.sql 2>/dev/null | \
grep -v '^$' | grep -v '^--' | ./corpus_test mysql
- name: Test against CockroachDB
run: |
git clone --depth 1 --sparse -q https://github.com/cockroachdb/cockroach.git /tmp/cockroach
cd /tmp/cockroach && git sparse-checkout set pkg/sql/parser/testdata 2>/dev/null && cd -
grep -rh "^[A-Z]" /tmp/cockroach/pkg/sql/parser/testdata/ 2>/dev/null | \
grep -v "^--" | grep -v "^#" | head -5000 | ./corpus_test pgsql
- name: Test against Vitess
run: |
git clone --depth 1 --sparse -q https://github.com/vitessio/vitess.git /tmp/vitess
cd /tmp/vitess && git sparse-checkout set go/vt/sqlparser 2>/dev/null && cd -
grep -ohP '"((?:select|SELECT|insert|INSERT|update|UPDATE|delete|DELETE|set|SET|create|CREATE|alter|ALTER|drop|DROP|explain|EXPLAIN)[^"]*)"' \
/tmp/vitess/go/vt/sqlparser/parse_test.go 2>/dev/null | \
sed 's/^"//' | sed 's/"$//' | head -2000 | ./corpus_test mysql
- name: Test against sqlparser-rs
run: |
git clone --depth 1 -q https://github.com/apache/datafusion-sqlparser-rs.git /tmp/sqlparser-rs
grep -ohP '"((?:SELECT|INSERT|UPDATE|DELETE|SET|CREATE|ALTER|DROP|EXPLAIN|WITH)[^"]*)"' \
/tmp/sqlparser-rs/tests/sqlparser_mysql.rs 2>/dev/null | \
sed 's/^"//' | sed 's/"$//' | sed 's/\\"/"/g' | ./corpus_test mysql
grep -ohP '"((?:SELECT|INSERT|UPDATE|DELETE|SET|CREATE|ALTER|DROP|EXPLAIN|WITH)[^"]*)"' \
/tmp/sqlparser-rs/tests/sqlparser_postgres.rs 2>/dev/null | \
sed 's/^"//' | sed 's/"$//' | sed 's/\\"/"/g' | ./corpus_test pgsql
pg-compat:
if: github.event_name != 'schedule'
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
PG_COMPAT_CACHE: /tmp/parsersql-pg-compat
steps:
- uses: actions/checkout@v4
- name: Cache PostgreSQL compatibility sources
uses: actions/cache@v4
with:
path: /tmp/parsersql-pg-compat
key: pg-compat-${{ runner.os }}-${{ hashFiles('tests/pg_compat/upstream_pins.json') }}
restore-keys: |
pg-compat-${{ runner.os }}-
- name: Test PostgreSQL compatibility gate
run: make -f Makefile test-pg-compat
pg-compat-full:
if: github.event_name == 'schedule'
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
PG_COMPAT_CACHE: /tmp/parsersql-pg-compat
steps:
- uses: actions/checkout@v4
- name: Cache PostgreSQL compatibility sources
uses: actions/cache@v4
with:
path: /tmp/parsersql-pg-compat
key: pg-compat-${{ runner.os }}-${{ hashFiles('tests/pg_compat/upstream_pins.json') }}
restore-keys: |
pg-compat-${{ runner.os }}-
- name: Validate full PostgreSQL compatibility baseline
run: make -f Makefile pg-compat