-
Notifications
You must be signed in to change notification settings - Fork 2
240 lines (190 loc) · 6.84 KB
/
benchmark.yaml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
on:
push
jobs:
benchmark-sqlite:
name: "⏲️ Benchmark: ${{ matrix.config.backend }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- backend: SQLite
id: sqlite
args: 'list(dbname = file.path(tempdir(), "SQLite.SQLite"))'
schemas: ''
- backend: SQLite - w. schemas
id: sqlite-schemas
args: 'list(dbname = file.path(tempdir(), "SQLite_schemas.SQLite"))'
schemas: test_ds,not_test_ds
env:
BACKEND: ${{ matrix.config.backend }}
BACKEND_DRV: RSQLite::SQLite
BACKEND_ARGS: ${{ matrix.config.args }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: '1'
extra-packages: any::covr, any::devtools
needs: coverage
- name: Setup BACKEND_POST_CONNECT
if: ${{ matrix.config.schemas != '' }}
run: |
set -o xtrace
IFS=',' read -ra schemas <<< "${{ matrix.config.schemas }}"
CONN_POST_CONNECT="list("
for schema in "${schemas[@]}"; do
CONN_POST_CONNECT+="paste0(\"ATTACH '\", file.path(tempdir(), \"SQLite_schemas_${schema}.SQLite\"), \"' AS '${schema}'\"), "
done
# Trim trailing ", " from CONN_POST_CONNECT
CONN_POST_CONNECT=${CONN_POST_CONNECT%??}
CONN_POST_CONNECT+=")"
echo "BACKEND_POST_CONNECT=$CONN_POST_CONNECT" >> $GITHUB_ENV
- name: Run benchmark
run: source("./data-raw/benchmark_update_snapshot.R", echo=TRUE)
shell: Rscript {0}
- name: Upload benchmark results
if: failure()
uses: actions/upload-artifact@v4
with:
name: benchmark-${{ matrix.config.id }}
path: ${{ runner.temp }}/package
benchmark-duckdb:
name: "⏲️ Benchmark: DuckDB"
runs-on: ubuntu-latest
env:
BACKEND: DuckDB
BACKEND_DRV: duckdb::duckdb
BACKEND_ARGS: 'list(dbdir = file.path(tempdir(), "DuckDB.duckdb"))'
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: ${{ inputs.cache_version }}
extra-packages: any::covr, any::devtools
needs: coverage
- name: Setup BACKEND_POST_CONNECT
run: |
set -o xtrace
IFS=',' read -ra schemas <<< "test_ds,not_test_ds"
CONN_POST_CONNECT="list("
for schema in "${schemas[@]}"; do
CONN_POST_CONNECT+="\"CREATE SCHEMA IF NOT EXISTS '${schema}';\", "
done
# Trim trailing ", " from CONN_POST_CONNECT
CONN_POST_CONNECT=${CONN_POST_CONNECT%??}
CONN_POST_CONNECT+=")"
echo "BACKEND_POST_CONNECT=$CONN_POST_CONNECT" >> $GITHUB_ENV
- name: Run benchmark
run: source("./data-raw/benchmark_update_snapshot.R", echo=TRUE)
shell: Rscript {0}
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-${{ matrix.config.id }}
path: ${{ runner.temp }}/package
benchmark-postgres:
name: "⏲️ Benchmark: PostgreSQL"
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5
env:
BACKEND: PostgreSQL
BACKEND_DRV: RPostgres::Postgres
BACKEND_ARGS: ''
PGHOST: localhost
PGPORT: 5432
PGDATABASE: test
PGUSER: postgres
PGPASSWORD: postgres
steps:
- name: Setup testing schemata in PostgreSQL
run: |
set -o xtrace
IFS=',' read -ra schemas <<< "test_ds,not_test_ds"
for schema in "${schemas[@]}"; do
psql test -c "CREATE SCHEMA \"$schema\";"
done
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: '1'
extra-packages: any::covr, any::devtools
needs: coverage
- name: Run benchmark
run: source("./data-raw/benchmark_update_snapshot.R", echo=TRUE)
shell: Rscript {0}
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-postgres
path: ${{ runner.temp }}/package
benchmark-mssql:
name: "⏲️ Benchmark: SQL Server 2019"
runs-on: ubuntu-latest
env:
BACKEND: MSSQL
BACKEND_DRV: odbc::odbc
BACKEND_ARGS: ''
CONN_ARGS_JSON: >
{
"MSSQL": {
"driver": "ODBC Driver 17 for SQL Server",
"server": "localhost",
"database": "master",
"UID": "SA",
"PWD": "dbatools.I0"
}
}
steps:
- name: Install a SQL Server suite of tools
uses: potatoqualitee/[email protected]
with:
install: sqlengine, sqlpackage, sqlclient
show-log: true
- name: Setup testing schemata in SQL server
run: |
set -o xtrace
sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -Q "ALTER LOGIN SA WITH DEFAULT_DATABASE = master;"
IFS=',' read -ra schemas <<< "test_ds,not_test_ds"
for schema in "${schemas[@]}"; do
sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "CREATE SCHEMA [$schema];"
sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "GO"
done
sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "SELECT * FROM sys.schemas"
sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE schema_name = 'test'"
sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE schema_name = 'test.one'"
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: '1'
extra-packages: any::covr, any::devtools
needs: coverage
- name: Run benchmark
run: source("./data-raw/benchmark_update_snapshot.R", echo=TRUE)
shell: Rscript {0}
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-mssql
path: ${{ runner.temp }}/package