@@ -158,6 +158,9 @@ jobs:
158
158
159
159
- run : echo "using ${DATABASE_URL}"
160
160
161
+ # Create data dir for offline mode
162
+ - run : mkdir .sqlx
163
+
161
164
- uses : actions-rs/cargo@v1
162
165
with :
163
166
command : test
@@ -168,6 +171,39 @@ jobs:
168
171
--test-threads=1
169
172
env :
170
173
DATABASE_URL : sqlite:tests/sqlite/sqlite.db
174
+ SQLX_OFFLINE_DIR : .sqlx
175
+ RUSTFLAGS : --cfg sqlite_ipaddr
176
+ LD_LIBRARY_PATH : /tmp/sqlite3-lib
177
+
178
+ # Remove test artifacts
179
+ - run : cargo clean -p sqlx
180
+
181
+ # Build the macros-test in offline mode (omit DATABASE_URL)
182
+ - uses : actions-rs/cargo@v1
183
+ with :
184
+ command : build
185
+ args : >
186
+ --no-default-features
187
+ --test sqlite-macros
188
+ --features any,macros,sqlite,_unstable-all-types,runtime-${{ matrix.runtime }}
189
+ env :
190
+ SQLX_OFFLINE : true
191
+ SQLX_OFFLINE_DIR : .sqlx
192
+ RUSTFLAGS : --cfg sqlite_ipaddr
193
+ LD_LIBRARY_PATH : /tmp/sqlite3-lib
194
+
195
+ # Test macros in offline mode (still needs DATABASE_URL to run)
196
+ - uses : actions-rs/cargo@v1
197
+ with :
198
+ command : test
199
+ args : >
200
+ --no-default-features
201
+ --test sqlite-macros
202
+ --features any,macros,sqlite,_unstable-all-types,runtime-${{ matrix.runtime }}
203
+ env :
204
+ DATABASE_URL : sqlite://tests/sqlite/sqlite.db
205
+ SQLX_OFFLINE : true
206
+ SQLX_OFFLINE_DIR : .sqlx
171
207
RUSTFLAGS : --cfg sqlite_ipaddr
172
208
LD_LIBRARY_PATH : /tmp/sqlite3-lib
173
209
@@ -207,6 +243,9 @@ jobs:
207
243
docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
208
244
docker exec postgres_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
209
245
246
+ # Create data dir for offline mode
247
+ - run : mkdir .sqlx
248
+
210
249
- uses : actions-rs/cargo@v1
211
250
with :
212
251
command : test
@@ -215,6 +254,7 @@ jobs:
215
254
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
216
255
env :
217
256
DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx
257
+ SQLX_OFFLINE_DIR : .sqlx
218
258
# FIXME: needed to disable `ltree` tests in Postgres 9.6
219
259
# but `PgLTree` should just fall back to text format
220
260
RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
@@ -228,6 +268,41 @@ jobs:
228
268
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
229
269
env :
230
270
DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt
271
+ SQLX_OFFLINE_DIR : .sqlx
272
+ # FIXME: needed to disable `ltree` tests in Postgres 9.6
273
+ # but `PgLTree` should just fall back to text format
274
+ RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
275
+
276
+ # Remove test artifacts
277
+ - run : cargo clean -p sqlx
278
+
279
+ # Build the macros-test in offline mode (omit DATABASE_URL)
280
+ - uses : actions-rs/cargo@v1
281
+ with :
282
+ command : build
283
+ args : >
284
+ --no-default-features
285
+ --test postgres-macros
286
+ --features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
287
+ env :
288
+ SQLX_OFFLINE : true
289
+ SQLX_OFFLINE_DIR : .sqlx
290
+ # FIXME: needed to disable `ltree` tests in Postgres 9.6
291
+ # but `PgLTree` should just fall back to text format
292
+ RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
293
+
294
+ # Test macros in offline mode (still needs DATABASE_URL to run)
295
+ - uses : actions-rs/cargo@v1
296
+ with :
297
+ command : test
298
+ args : >
299
+ --no-default-features
300
+ --test postgres-macros
301
+ --features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
302
+ env :
303
+ DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx
304
+ SQLX_OFFLINE : true
305
+ SQLX_OFFLINE_DIR : .sqlx
231
306
# FIXME: needed to disable `ltree` tests in Postgres 9.6
232
307
# but `PgLTree` should just fall back to text format
233
308
RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
@@ -283,6 +358,9 @@ jobs:
283
358
- run : docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mysql_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
284
359
- run : sleep 60
285
360
361
+ # Create data dir for offline mode
362
+ - run : mkdir .sqlx
363
+
286
364
- uses : actions-rs/cargo@v1
287
365
with :
288
366
command : test
@@ -291,6 +369,7 @@ jobs:
291
369
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
292
370
env :
293
371
DATABASE_URL : mysql://root:password@localhost:3306/sqlx?ssl-mode=disabled
372
+ SQLX_OFFLINE_DIR : .sqlx
294
373
RUSTFLAGS : --cfg mysql_${{ matrix.mysql }}
295
374
296
375
# MySQL 5.7 supports TLS but not TLSv1.3 as required by RusTLS.
@@ -303,6 +382,39 @@ jobs:
303
382
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
304
383
env :
305
384
DATABASE_URL : mysql://root:password@localhost:3306/sqlx
385
+ SQLX_OFFLINE_DIR : .sqlx
386
+ RUSTFLAGS : --cfg mysql_${{ matrix.mysql }}
387
+
388
+ # Remove test artifacts
389
+ - run : cargo clean -p sqlx
390
+
391
+ # Build the macros-test in offline mode (omit DATABASE_URL)
392
+ - uses : actions-rs/cargo@v1
393
+ with :
394
+ command : build
395
+ args : >
396
+ --no-default-features
397
+ --test mysql-macros
398
+ --features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
399
+ env :
400
+ SQLX_OFFLINE : true
401
+ SQLX_OFFLINE_DIR : .sqlx
402
+ RUSTFLAGS : --cfg mysql_${{ matrix.mysql }}
403
+
404
+ # Test macros in offline mode (still needs DATABASE_URL to run)
405
+ # MySQL 5.7 supports TLS but not TLSv1.3 as required by RusTLS.
406
+ - uses : actions-rs/cargo@v1
407
+ if : ${{ !(matrix.mysql == '5_7' && matrix.tls == 'rustls') }}
408
+ with :
409
+ command : test
410
+ args : >
411
+ --no-default-features
412
+ --test mysql-macros
413
+ --features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
414
+ env :
415
+ DATABASE_URL : mysql://root:password@localhost:3306/sqlx
416
+ SQLX_OFFLINE : true
417
+ SQLX_OFFLINE_DIR : .sqlx
306
418
RUSTFLAGS : --cfg mysql_${{ matrix.mysql }}
307
419
308
420
# client SSL authentication
@@ -355,14 +467,48 @@ jobs:
355
467
- run : docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mariadb_${{ matrix.mariadb }} mariadb_${{ matrix.mariadb }}
356
468
- run : sleep 30
357
469
470
+ # Create data dir for offline mode
471
+ - run : mkdir .sqlx
472
+
473
+ - uses : actions-rs/cargo@v1
474
+ with :
475
+ command : test
476
+ args : >
477
+ --no-default-features
478
+ --features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
479
+ env :
480
+ DATABASE_URL : mysql://root:password@localhost:3306/sqlx
481
+ SQLX_OFFLINE_DIR : .sqlx
482
+ RUSTFLAGS : --cfg mariadb_${{ matrix.mariadb }}
483
+
484
+ # Remove test artifacts
485
+ - run : cargo clean -p sqlx
486
+
487
+ # Build the macros-test in offline mode (omit DATABASE_URL)
488
+ - uses : actions-rs/cargo@v1
489
+ with :
490
+ command : build
491
+ args : >
492
+ --no-default-features
493
+ --test mysql-macros
494
+ --features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
495
+ env :
496
+ SQLX_OFFLINE : true
497
+ SQLX_OFFLINE_DIR : .sqlx
498
+ RUSTFLAGS : --cfg mariadb_${{ matrix.mariadb }}
499
+
500
+ # Test macros in offline mode (still needs DATABASE_URL to run)
358
501
- uses : actions-rs/cargo@v1
359
502
with :
360
503
command : test
361
504
args : >
362
505
--no-default-features
506
+ --test mysql-macros
363
507
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
364
508
env :
365
509
DATABASE_URL : mysql://root:password@localhost:3306/sqlx
510
+ SQLX_OFFLINE : true
511
+ SQLX_OFFLINE_DIR : .sqlx
366
512
RUSTFLAGS : --cfg mariadb_${{ matrix.mariadb }}
367
513
368
514
# client SSL authentication
0 commit comments