-
-
Notifications
You must be signed in to change notification settings - Fork 160
64 lines (55 loc) · 1.54 KB
/
test-fmt-check.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: Test terraform-fmt-check
on:
- pull_request
permissions:
contents: read
jobs:
canonical_fmt:
runs-on: ubuntu-24.04
name: Canonical fmt
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: fmt-check
uses: ./terraform-fmt-check
id: fmt-check
with:
path: tests/workflows/test-fmt-check/canonical
- name: Check valid
env:
FAILURE_REASON: ${{ steps.fmt-check.outputs.failure-reason }}
run: |
if [[ "$FAILURE_REASON" != "" ]]; then
echo "::error:: failure-reason not set correctly"
exit 1
fi
non_canonical_fmt:
runs-on: ubuntu-24.04
name: Non canonical fmt
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: fmt-check
uses: ./terraform-fmt-check
continue-on-error: true
id: fmt-check
with:
path: tests/workflows/test-fmt-check/non-canonical
- name: Check invalid
env:
OUTCOME: ${{ steps.fmt-check.outcome }}
FAILURE_REASON: ${{ steps.fmt-check.outputs.failure-reason }}
run: |
if [[ "$OUTCOME" != "failure" ]]; then
echo "fmt-check did not fail correctly"
exit 1
fi
if [[ "$FAILURE_REASON" != "check-failed" ]]; then
echo "::error:: failure-reason not set correctly"
exit 1
fi