@@ -170,16 +170,47 @@ jobs:
170
170
target
171
171
key : ${{ runner.os }}-sqlite-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}
172
172
173
+ # Create data dir for offline mode
174
+ - run : mkdir .sqlx
175
+
176
+ - uses : actions-rs/cargo@v1
177
+ with :
178
+ command : test
179
+ args : >
180
+ --no-default-features
181
+ --features any,macros,migrate,sqlite,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
182
+ --
183
+ --test-threads=1
184
+ env :
185
+ DATABASE_URL : sqlite://tests/sqlite/sqlite.db
186
+
187
+ # Remove test artifacts
188
+ - run : cargo clean -p sqlx
189
+
190
+ # Build the macros-test in offline mode (omit DATABASE_URL)
191
+ - uses : actions-rs/cargo@v1
192
+ with :
193
+ command : build
194
+ args : >
195
+ --no-default-features
196
+ --test sqlite-macros
197
+ --features any,macros,migrate,sqlite,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
198
+ env :
199
+ SQLX_OFFLINE : true
200
+
201
+ # Test macros in offline mode (still needs DATABASE_URL to run)
173
202
- uses : actions-rs/cargo@v1
174
203
with :
175
204
command : test
176
205
args : >
177
206
--no-default-features
178
- --features any,macros,migrate,sqlite,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
207
+ --test sqlite-macros
208
+ --features any,macros,migrate,sqlite,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
179
209
--
180
210
--test-threads=1
181
211
env :
182
212
DATABASE_URL : sqlite://tests/sqlite/sqlite.db
213
+ SQLX_OFFLINE : true
183
214
184
215
postgres :
185
216
name : Postgres
@@ -207,6 +238,9 @@ jobs:
207
238
target
208
239
key : ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}
209
240
241
+ # Create data dir for offline mode
242
+ - run : mkdir .sqlx
243
+
210
244
- uses : actions-rs/cargo@v1
211
245
env :
212
246
# FIXME: needed to disable `ltree` tests in Postgres 9.6
@@ -226,7 +260,7 @@ jobs:
226
260
command : test
227
261
args : >
228
262
--no-default-features
229
- --features any,postgres,macros,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
263
+ --features any,postgres,macros,all-types,offline, runtime-${{ matrix.runtime }}-${{ matrix.tls }}
230
264
env :
231
265
DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx
232
266
# FIXME: needed to disable `ltree` tests in Postgres 9.6
@@ -238,13 +272,45 @@ jobs:
238
272
command : test
239
273
args : >
240
274
--no-default-features
241
- --features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
275
+ --features any,postgres,macros,migrate,all-types,offline, runtime-${{ matrix.runtime }}-${{ matrix.tls }}
242
276
env :
243
277
DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt
244
278
# FIXME: needed to disable `ltree` tests in Postgres 9.6
245
279
# but `PgLTree` should just fall back to text format
246
280
RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
247
281
282
+ # Remove test artifacts
283
+ - run : cargo clean -p sqlx
284
+
285
+ # Build the macros-test in offline mode (omit DATABASE_URL)
286
+ - uses : actions-rs/cargo@v1
287
+ with :
288
+ command : build
289
+ args : >
290
+ --no-default-features
291
+ --test postgres-macros
292
+ --features any,postgres,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
293
+ env :
294
+ SQLX_OFFLINE : true
295
+ # FIXME: needed to disable `ltree` tests in Postgres 9.6
296
+ # but `PgLTree` should just fall back to text format
297
+ RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
298
+
299
+ # Test macros in offline mode (still needs DATABASE_URL to run)
300
+ - uses : actions-rs/cargo@v1
301
+ with :
302
+ command : test
303
+ args : >
304
+ --no-default-features
305
+ --test postgres-macros
306
+ --features any,postgres,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
307
+ env :
308
+ DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx
309
+ SQLX_OFFLINE : true
310
+ # FIXME: needed to disable `ltree` tests in Postgres 9.6
311
+ # but `PgLTree` should just fall back to text format
312
+ RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
313
+
248
314
mysql :
249
315
name : MySQL
250
316
runs-on : ubuntu-20.04
@@ -271,6 +337,9 @@ jobs:
271
337
target
272
338
key : ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}
273
339
340
+ # Create data dir for offline mode
341
+ - run : mkdir .sqlx
342
+
274
343
- uses : actions-rs/cargo@v1
275
344
with :
276
345
command : build
@@ -285,10 +354,36 @@ jobs:
285
354
command : test
286
355
args : >
287
356
--no-default-features
288
- --features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
357
+ --features any,mysql,macros,migrate,all-types,offline, runtime-${{ matrix.runtime }}-${{ matrix.tls }}
289
358
env :
290
359
DATABASE_URL : mysql://root:password@localhost:3306/sqlx
291
360
361
+ # Remove test artifacts
362
+ - run : cargo clean -p sqlx
363
+
364
+ # Build the macros-test in offline mode (omit DATABASE_URL)
365
+ - uses : actions-rs/cargo@v1
366
+ with :
367
+ command : build
368
+ args : >
369
+ --no-default-features
370
+ --test mysql-macros
371
+ --features any,mysql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
372
+ env :
373
+ SQLX_OFFLINE : true
374
+
375
+ # Test macros in offline mode (still needs DATABASE_URL to run)
376
+ - uses : actions-rs/cargo@v1
377
+ with :
378
+ command : test
379
+ args : >
380
+ --no-default-features
381
+ --test mysql-macros
382
+ --features any,mysql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
383
+ env :
384
+ DATABASE_URL : mysql://root:password@localhost:3306/sqlx
385
+ SQLX_OFFLINE : true
386
+
292
387
mariadb :
293
388
name : MariaDB
294
389
runs-on : ubuntu-20.04
@@ -316,6 +411,9 @@ jobs:
316
411
target
317
412
key : ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}
318
413
414
+ # Create data dir for offline mode
415
+ - run : mkdir .sqlx
416
+
319
417
- uses : actions-rs/cargo@v1
320
418
with :
321
419
command : build
@@ -330,9 +428,35 @@ jobs:
330
428
command : test
331
429
args : >
332
430
--no-default-features
333
- --features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
431
+ --features any,mysql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
432
+ env :
433
+ DATABASE_URL : mysql://root:password@localhost:3306/sqlx
434
+
435
+ # Remove test artifacts
436
+ - run : cargo clean -p sqlx
437
+
438
+ # Build the macros-test in offline mode (omit DATABASE_URL)
439
+ - uses : actions-rs/cargo@v1
440
+ with :
441
+ command : build
442
+ args : >
443
+ --no-default-features
444
+ --test mysql-macros
445
+ --features any,mysql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
446
+ env :
447
+ SQLX_OFFLINE : true
448
+
449
+ # Test macros in offline mode (still needs DATABASE_URL to run)
450
+ - uses : actions-rs/cargo@v1
451
+ with :
452
+ command : test
453
+ args : >
454
+ --no-default-features
455
+ --test mysql-macros
456
+ --features any,mysql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
334
457
env :
335
458
DATABASE_URL : mysql://root:password@localhost:3306/sqlx
459
+ SQLX_OFFLINE : true
336
460
337
461
mssql :
338
462
name : MSSQL
@@ -360,6 +484,9 @@ jobs:
360
484
target
361
485
key : ${{ runner.os }}-mssql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}
362
486
487
+ # Create data dir for offline mode
488
+ - run : mkdir .sqlx
489
+
363
490
- uses : actions-rs/cargo@v1
364
491
with :
365
492
command : build
@@ -374,6 +501,32 @@ jobs:
374
501
command : test
375
502
args : >
376
503
--no-default-features
377
- --features any,mssql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
504
+ --features any,mssql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
505
+ env :
506
+ DATABASE_URL : mssql://sa:Password123!@localhost/sqlx
507
+
508
+ # Remove test artifacts
509
+ - run : cargo clean -p sqlx
510
+
511
+ # Build the macros-test in offline mode (omit DATABASE_URL)
512
+ - uses : actions-rs/cargo@v1
513
+ with :
514
+ command : build
515
+ args : >
516
+ --no-default-features
517
+ --test mssql-macros
518
+ --features any,mssql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
519
+ env :
520
+ SQLX_OFFLINE : true
521
+
522
+ # Test macros in offline mode (still needs DATABASE_URL to run)
523
+ - uses : actions-rs/cargo@v1
524
+ with :
525
+ command : test
526
+ args : >
527
+ --no-default-features
528
+ --test mssql-macros
529
+ --features any,mssql,macros,migrate,all-types,offline,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
378
530
env :
379
531
DATABASE_URL : mssql://sa:Password123!@localhost/sqlx
532
+ SQLX_OFFLINE : true
0 commit comments