-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 1.54 KB
/
integration-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: Integration Tests
on:
pull_request:
paths:
- "action.yaml"
- "gha_extract_shell_scripts.py"
- ".github/workflows/integration-tests.yaml"
jobs:
test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./
id: gha-extract-shell-scripts
- name: Test extracted
run: |
output_file="workflow_scripts/${{ env.workflow_file }}/job=Test/step=Test_extracted.sh"
expected="$(expected="$(sed "s/'/'\\\\''/g" <<<"$expected")" envsubst '$expected' <<<"$expected")"
if [[ ! -f "$output_file" ]]; then
find .
exit 1
fi
cat "$output_file"
echo "---"
echo "$expected"
echo "---"
diff --color=always <"$output_file" <<<"$expected"
env:
expected: |
#!/usr/bin/env bash
set -e
# shellcheck disable=SC2034
expected='$expected'
# shellcheck disable=SC2034
workflow_file='integration-tests.yaml'
# ---
output_file="workflow_scripts/:env.workflow_file:/job=Test/step=Test_extracted.sh"
expected="$(expected="$(sed "s/'/'\\\\''/g" <<<"\$expected")" envsubst '\$expected' <<<"\$expected")"
if [[ ! -f "$output_file" ]]; then
find .
exit 1
fi
diff --color=always <"$output_file" <<<"\$expected"
workflow_file: integration-tests.yaml