@@ -360,20 +360,23 @@ jobs:
360
360
runs-on : ubuntu-latest
361
361
needs :
362
362
- setup-workflow
363
+ - get-called-ref
363
364
if : ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
365
+ # outputs from `dynamic-uses` action are passed as a JSON string
364
366
outputs :
365
- unit : ${{ steps.test-inventory.outputs.unit }}
366
- ucc_modinput_functional : ${{ steps.test-inventory.outputs.ucc_modinput_functional}}
367
- modinput_functional : ${{ steps.test-inventory.outputs.modinput_functional}}
368
- requirement_test : ${{ steps.test-inventory.outputs.requirement_test }}
369
- knowledge : ${{ steps.test-inventory.outputs.knowledge }}
370
- ui : ${{ steps.test-inventory.outputs.ui }}
371
- scripted_inputs : ${{ steps.test-inventory.outputs.scripted_inputs }}
372
- escu : ${{ steps.test-inventory.outputs.escu }}
367
+ unit : ${{ fromJSON( steps.test-inventory.outputs.outputs) .unit }}
368
+ ucc_modinput_functional : ${{ fromJSON( steps.test-inventory.outputs.outputs). ucc_modinput_functional }}
369
+ modinput_functional : ${{ fromJSON( steps.test-inventory.outputs.outputs). modinput_functional }}
370
+ requirement_test : ${{ fromJSON( steps.test-inventory.outputs.outputs) .requirement_test }}
371
+ knowledge : ${{ fromJSON( steps.test-inventory.outputs) .knowledge }}
372
+ ui : ${{ fromJSON( steps.test-inventory.outputs) .ui }}
373
+ scripted_inputs : ${{ fromJSON( steps.test-inventory.outputs) .scripted_inputs }}
374
+ escu : ${{ fromJSON( steps.test-inventory.outputs) .escu }}
373
375
steps :
374
- - name : Run test inventory check
376
+ - uses : jenseng/dynamic-uses@v1
375
377
id : test-inventory
376
- uses : ./.github/actions/test-inventory
378
+ with :
379
+ uses : splunk/addonfactory-workflow-addon-release/.github/actions/test-inventory@${{ needs.get-called-ref.outputs.ref }}
377
380
378
381
# Two separate unit test jobs needed as jobs that depend on unit-test success can't proceed
379
382
# if any matrix job fails. Currently python 3.9 may fail as it's not supported in all TAs.
@@ -383,8 +386,13 @@ jobs:
383
386
name : Unit tests python 3.7
384
387
if : ${{ needs.test-inventory.outputs.unit == 'true' }}
385
388
runs-on : ubuntu-latest
389
+ # inputs to `dynamic-uses` step
390
+ env :
391
+ python_version : 3.7
392
+ GH_TOKEN_ADMIN : ${{ secrets.GH_TOKEN_ADMIN }}
386
393
needs :
387
394
- test-inventory
395
+ - get-called-ref
388
396
permissions :
389
397
actions : read
390
398
deployments : read
@@ -393,20 +401,24 @@ jobs:
393
401
statuses : read
394
402
checks : write
395
403
steps :
396
- - name : Run unit tests for python 3.7
397
- id : unit-tests-3_7
398
- uses : ./.github/actions/unit-tests
404
+ - uses : jenseng/dynamic-uses@v1
399
405
with :
400
- python_version : ' 3.7'
401
- GH_TOKEN_ADMIN : ${{ secrets.GH_TOKEN_ADMIN }}
406
+ uses : splunk/addonfactory-workflow-addon-release/.github/actions/unit-tests@${{ needs.get-called-ref.outputs.ref }}
407
+ # inputs need to provided as a valid JSON string
408
+ with : ${{ toJSON(env) }}
402
409
403
410
run-unit-tests-3_9 :
404
411
name : Unit tests python 3.9
405
412
if : ${{ needs.test-inventory.outputs.unit == 'true' }}
406
413
runs-on : ubuntu-latest
407
414
continue-on-error : true
415
+ # inputs to `dynamic-uses` step
416
+ env :
417
+ python_version : 3.7
418
+ GH_TOKEN_ADMIN : ${{ secrets.GH_TOKEN_ADMIN }}
408
419
needs :
409
420
- test-inventory
421
+ - get-called-ref
410
422
permissions :
411
423
actions : read
412
424
deployments : read
@@ -415,12 +427,11 @@ jobs:
415
427
statuses : read
416
428
checks : write
417
429
steps :
418
- - name : Run unit tests for python 3.9
419
- id : unit-tests-3_9
420
- uses : ./.github/actions/unit-tests
430
+ - uses : jenseng/dynamic-uses@v1
421
431
with :
422
- python_version : ' 3.9'
423
- GH_TOKEN_ADMIN : ${{ secrets.GH_TOKEN_ADMIN }}
432
+ uses : splunk/addonfactory-workflow-addon-release/.github/actions/unit-tests@${{ needs.get-called-ref.outputs.ref }}
433
+ # inputs need to provided as a valid JSON string
434
+ with : ${{ toJSON(env) }}
424
435
425
436
build :
426
437
name : Build python 3.7
0 commit comments