-
-
Notifications
You must be signed in to change notification settings - Fork 18
64 lines (55 loc) · 2.01 KB
/
tf_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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
name: TF Tests
on:
pull_request:
paths: [.github/workflows/tf_tests.yaml, tests/**, action.*]
types: [opened, reopened, synchronize, closed]
jobs:
tests:
runs-on: ubuntu-latest
permissions:
actions: read # Required to download repository artifact.
checks: write # Required to add status summary.
contents: read # Required to checkout repository.
pull-requests: write # Required to add PR comment and label.
strategy:
fail-fast: false
matrix:
tool: [tofu, terraform]
path:
- fail_invalid_resource_type
- fail_data_source_error
- pass_one
- pass_character_limit
- pass_format_diff
steps:
- name: Echo github
env:
GH_JSON: ${{ toJson(github) }}
run: echo "$GH_JSON"
- name: Echo context
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: console.log(JSON.stringify(context, null, 2))
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Provision TF
id: tf
continue-on-error: true
uses: ./
with:
arg_chdir: tests/${{ matrix.path }}
arg_command: ${{ github.event.pull_request.merged && 'apply' || 'plan' }}
arg_lock: ${{ github.event.pull_request.merged && 'true' || 'false' }}
tf_tool: ${{ matrix.tool }}
tf_version: ~> 1.8.0
- name: Echo TF
run: |
echo "check_id: ${{ steps.tf.outputs.check_id }}"
echo "comment_id: ${{ steps.tf.outputs.comment_id }}"
echo "fmt_result: ${{ steps.tf.outputs.fmt_result }}"
echo "header: ${{ steps.tf.outputs.header }}"
echo "identifier: ${{ steps.tf.outputs.identifier }}"
echo "last_result: ${{ steps.tf.outputs.last_result }}"
echo "outline: ${{ steps.tf.outputs.outline }}"
echo "summary: ${{ steps.tf.outputs.summary }}"