-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (93 loc) · 3.39 KB
/
CICD.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: "Build"
on: [push, pull_request]
jobs:
Matrix:
runs-on: ubuntu-latest
steps:
- name: Generate Matrix
id: matrix
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
minimum_tf_version: '1.7.0'
additional_runners: 'macos-13, windows-2019'
additional_images: 'amazonlinux:2'
- name: Output Matrix
run: |
echo "Strategy: ${{ steps.matrix.outputs.strategy }}"
outputs:
strategy: ${{ steps.matrix.outputs.strategy }}
Test:
needs: [Matrix]
strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}}
runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.container }}
steps:
- name: Initialize - Pass
id: init-pass
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/pass
- name: Run Tests - Pass
id: tests-pass
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/pass
- name: Initialize - Pass (With Output)
id: init-pass-output
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/pass-output
- name: Run Tests - Pass (With Output)
id: tests-pass-output
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/pass-output
- name: Initialize - Pass - Delayed
id: init-pass-delayed
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/pass-delayed
- name: Run Tests - Pass - Delayed
id: tests-pass-delayed
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/pass-delayed
- name: Initialize - Fail
id: init-fail
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/fail
- name: Run Tests - Fail
id: tests-fail
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/fail
- name: Initialize - Fail (Output)
id: init-fail-output
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/fail-output
- name: Run Tests - Fail (Output)
id: tests-fail-output
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/fail-output
- name: Initialize - Fail - Delayed
id: init-fail-delayed
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/fail-delayed
- name: Run Tests - Fail - Delayed
id: tests-fail-delayed
uses: Invicton-Labs/terraform-module-testing/[email protected]
with:
tf_path: tests/fail-delayed
# This job just waits for all other jobs to pass. We have it here
# so our branch protection rule can reference a single job, instead
# of needing to list every matrix value of every job above.
Passed:
runs-on: ubuntu-latest
needs: [Test]
steps:
- name: Mark tests as passed
run: echo "🎉"