-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.35 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
50
---
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
- name: Run action
id: self
uses: ./
- name: Target step
run: |
echo "${{ env.greeting }}, $name"
env:
greeting: Hello
name: Integration Tests
- name: Test extracted
run: |
if [[ -f "$output_file" ]]; then
echo "Output:"
cat -n "$output_file"
echo "Expected:"
cat -n <<<"$expected"
else
find "${output_dir:?}"
exit 1
fi
diff --color=always "${output_file:?}" <(echo "${expected:?}")
env:
output_dir: ${{ steps.self.outputs.output-dir }}
output_file: ${{ steps.self.outputs.output-dir }}/integration-tests.yaml/job=Test/step=Target_step.sh
expected: |-
#!/usr/bin/env bash
set -e
# shellcheck disable=SC2016,SC2034
greeting='Hello'
# shellcheck disable=SC2016,SC2034
name='Integration Tests'
# ---
echo ":env.greeting:, $name"