-
-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (85 loc) · 2.33 KB
/
pipeline.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
name: Terraform
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]
branches: [main]
release:
types: [published]
jobs:
check-format:
runs-on: ubuntu-latest
container: hashicorp/terraform
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Terraform Format Check
run: terraform fmt -check -recursive -diff
validate:
runs-on: ubuntu-latest
container: hashicorp/terraform
strategy:
matrix: {
dir: [
'examples/basic',
'examples/log-configuration-cw',
'examples/log-configuration-s3',
'examples/setting-container-insights',
'examples/service-connect-defaults'
]
}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Terraform Init
run: terraform init -upgrade
working-directory: ${{ matrix.dir }}
- name: Terraform Validate
run: terraform validate
working-directory: ${{ matrix.dir }}
mock-plan:
runs-on: ubuntu-latest
container: hashicorp/terraform
strategy:
matrix: {
dir: [
'examples/basic',
'examples/log-configuration-cw',
'examples/log-configuration-s3',
'examples/setting-container-insights',
'examples/service-connect-defaults'
]
}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Terraform Init
run: terraform init -upgrade
working-directory: ${{ matrix.dir }}
- name: Terraform Plan (Mock)
run: terraform plan
working-directory: ${{ matrix.dir }}
infracost:
runs-on: ubuntu-latest
name: Show infracost diff
strategy:
matrix: {
dir: [
'examples/basic',
'examples/log-configuration-cw',
'examples/log-configuration-s3',
'examples/setting-container-insights',
'examples/service-connect-defaults'
]
}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run infracost diff
uses: infracost/infracost-gh-action@master
env:
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: ${{ matrix.dir }}