Skip to content

Commit aecb5b6

Browse files
committed
Update pre-commit hook and pipeline
1 parent 99aadad commit aecb5b6

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

.github/workflows/pipeline.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,67 @@
11
name: Terraform
2-
on: [push]
2+
on:
3+
push:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
37
jobs:
48
check-format:
59
runs-on: ubuntu-latest
610
container: hashicorp/terraform
711
steps:
812
- name: Checkout repository
913
uses: actions/checkout@v3
10-
- run: terraform fmt -check -recursive -diff
14+
- name: Terraform Format Check
15+
run: terraform fmt -check -recursive -diff
1116

1217
validate:
1318
runs-on: ubuntu-latest
1419
container: hashicorp/terraform
20+
strategy:
21+
matrix: {
22+
dir: ['examples/test']
23+
}
1524
steps:
1625
- name: Checkout repository
1726
uses: actions/checkout@v3
1827
- name: Terraform Init
1928
run: terraform init -upgrade
20-
working-directory: examples/test
29+
working-directory: ${{ matrix.dir }}
2130
- name: Terraform Validate
2231
run: terraform validate
23-
working-directory: examples/test
32+
working-directory: ${{ matrix.dir }}
2433

2534
mock-plan:
2635
runs-on: ubuntu-latest
2736
container: hashicorp/terraform
37+
strategy:
38+
matrix: {
39+
dir: ['examples/test']
40+
}
2841
steps:
2942
- name: Checkout repository
3043
uses: actions/checkout@v3
3144
- name: Terraform Init
3245
run: terraform init -upgrade
33-
working-directory: examples/test
46+
working-directory: ${{ matrix.dir }}
3447
- name: Terraform Plan (Mock)
3548
run: terraform plan
36-
working-directory: examples/test
49+
working-directory: ${{ matrix.dir }}
3750

3851
infracost:
3952
runs-on: ubuntu-latest
4053
name: Show infracost diff
54+
strategy:
55+
matrix: {
56+
dir: ['examples/test']
57+
}
4158
steps:
4259
- name: Check out repository
43-
uses: actions/checkout@v3
60+
uses: actions/checkout@v2
4461
- name: Run infracost diff
4562
uses: infracost/infracost-gh-action@master
4663
env:
4764
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }}
4865
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4966
with:
50-
path: examples/test
67+
path: ${{ matrix.dir }}

0 commit comments

Comments
 (0)