@@ -348,8 +348,17 @@ jobs:
348
348
function buildTask(~)
349
349
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'building\n'); fclose(f);
350
350
351
- function testTask(~)
352
- f = fopen('buildlog.txt', 'a+'); fprintf(f, 'testing\n'); fclose(f);
351
+ function testTask(~,tests,options)
352
+ arguments
353
+ ~
354
+ tests string = "tests"
355
+ options.OutputDetail (1,1) string = "terse"
356
+ end
357
+ f = fopen('buildlog.txt', 'a+');
358
+ fprintf(f, 'testing\n');
359
+ fprintf(f, '%s\n', tests);
360
+ fprintf(f, '%s\n', options.OutputDetail);
361
+ fclose(f);
353
362
354
363
function deployTask(~)
355
364
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'deploying\n'); fclose(f);
@@ -367,6 +376,8 @@ jobs:
367
376
set -e
368
377
grep "building" buildlog.txt
369
378
grep "testing" buildlog.txt
379
+ grep "tests" buildlog.txt
380
+ grep "terse" buildlog.txt
370
381
grep "deploying" buildlog.txt
371
382
! grep "checking" buildlog.txt
372
383
rm buildlog.txt
@@ -380,20 +391,39 @@ jobs:
380
391
set -e
381
392
grep "building" buildlog.txt
382
393
grep "testing" buildlog.txt
394
+ grep "tests" buildlog.txt
395
+ grep "terse" buildlog.txt
383
396
grep "deploying" buildlog.txt
384
397
grep "checking" buildlog.txt
385
398
rm buildlog.txt
386
399
shell : bash
400
+ # run build with task args
401
+ - matlab/run-build :
402
+ tasks : test("myTests",OutputDetail="concise")
403
+ - run :
404
+ name : Verify that correct tasks appear in buildlog.txt
405
+ command : |
406
+ set -e
407
+ grep "building" buildlog.txt
408
+ grep "testing" buildlog.txt
409
+ grep "myTests" buildlog.txt
410
+ grep "concise" buildlog.txt
411
+ ! grep "deploying" buildlog.txt
412
+ ! grep "checking" buildlog.txt
413
+ rm buildlog.txt
414
+ shell : bash
387
415
# run build with default tasks
388
416
- matlab/run-build :
389
417
startup-options : -logfile console.log
390
418
- run :
391
- name : Verify that correct tasks appear in buildlog.txt
419
+ name : Verify that correct tasks appear in buildlog.txt and console.log
392
420
command : |
393
421
set -e
394
422
grep "building" buildlog.txt
395
423
grep "build" console.log
396
424
grep "testing" buildlog.txt
425
+ grep "tests" buildlog.txt
426
+ grep "terse" buildlog.txt
397
427
grep "test" console.log
398
428
! grep "deploying" buildlog.txt
399
429
! grep "deploy" console.log
@@ -402,6 +432,22 @@ jobs:
402
432
rm buildlog.txt
403
433
rm console.log
404
434
shell : bash
435
+ # run build with task skipping
436
+ - matlab/run-build :
437
+ tasks : deploy
438
+ build-options : -skip test
439
+ - run :
440
+ name : Verify that correct tasks appear in buildlog.txt
441
+ command : |
442
+ set -e
443
+ grep "building" buildlog.txt
444
+ ! grep "testing" buildlog.txt
445
+ ! grep "tests" buildlog.txt
446
+ ! grep "terse" buildlog.txt
447
+ grep "deploying" buildlog.txt
448
+ ! grep "checking" buildlog.txt
449
+ rm buildlog.txt
450
+ shell : bash
405
451
406
452
workflows :
407
453
test-deploy :
0 commit comments