Skip to content

Commit d2e2adf

Browse files
committed
CI: add pre-test-script workflow call variable
This allows a caller (Spin) to run arbitrary code before test starts. Signed-off-by: Richard Alpe <[email protected]>
1 parent 737b131 commit d2e2adf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ on:
2929
required: false
3030
type: string
3131
default: 'test'
32+
pre_test_script:
33+
required: false
34+
type: string
35+
default: ''
36+
description: 'Optional script to run after checkout (for spin customization)'
3237
secrets:
3338
CHECKOUT_TOKEN:
3439
required: false
@@ -65,6 +70,15 @@ jobs:
6570
submodules: recursive
6671
token: ${{ secrets.CHECKOUT_TOKEN || github.token }}
6772

73+
- name: Run pre-test script
74+
if: ${{ inputs.pre_test_script != '' }}
75+
run: |
76+
cat > ./pre-test.sh << 'EOF'
77+
${{ inputs.pre_test_script }}
78+
EOF
79+
chmod +x ./pre-test.sh
80+
bash ./pre-test.sh
81+
6882
- name: Set Build Variables
6983
id: vars
7084
run: |

0 commit comments

Comments
 (0)