|
1 | 1 | name: Terraform |
2 | | -on: [push] |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + types: [opened, reopened, synchronize] |
| 6 | + |
3 | 7 | jobs: |
4 | 8 | check-format: |
5 | 9 | runs-on: ubuntu-latest |
6 | 10 | container: hashicorp/terraform |
7 | 11 | steps: |
8 | 12 | - name: Checkout repository |
9 | 13 | uses: actions/checkout@v3 |
10 | | - - run: terraform fmt -check -recursive -diff |
| 14 | + - name: Terraform Format Check |
| 15 | + run: terraform fmt -check -recursive -diff |
11 | 16 |
|
12 | 17 | validate: |
13 | 18 | runs-on: ubuntu-latest |
14 | 19 | container: hashicorp/terraform |
| 20 | + strategy: |
| 21 | + matrix: { |
| 22 | + dir: ['examples/test'] |
| 23 | + } |
15 | 24 | steps: |
16 | 25 | - name: Checkout repository |
17 | 26 | uses: actions/checkout@v3 |
18 | 27 | - name: Terraform Init |
19 | 28 | run: terraform init -upgrade |
20 | | - working-directory: examples/test |
| 29 | + working-directory: ${{ matrix.dir }} |
21 | 30 | - name: Terraform Validate |
22 | 31 | run: terraform validate |
23 | | - working-directory: examples/test |
| 32 | + working-directory: ${{ matrix.dir }} |
24 | 33 |
|
25 | 34 | mock-plan: |
26 | 35 | runs-on: ubuntu-latest |
27 | 36 | container: hashicorp/terraform |
| 37 | + strategy: |
| 38 | + matrix: { |
| 39 | + dir: ['examples/test'] |
| 40 | + } |
28 | 41 | steps: |
29 | 42 | - name: Checkout repository |
30 | 43 | uses: actions/checkout@v3 |
31 | 44 | - name: Terraform Init |
32 | 45 | run: terraform init -upgrade |
33 | | - working-directory: examples/test |
| 46 | + working-directory: ${{ matrix.dir }} |
34 | 47 | - name: Terraform Plan (Mock) |
35 | 48 | run: terraform plan |
36 | | - working-directory: examples/test |
| 49 | + working-directory: ${{ matrix.dir }} |
37 | 50 |
|
38 | 51 | infracost: |
39 | 52 | runs-on: ubuntu-latest |
40 | 53 | name: Show infracost diff |
| 54 | + strategy: |
| 55 | + matrix: { |
| 56 | + dir: ['examples/test'] |
| 57 | + } |
41 | 58 | steps: |
42 | 59 | - name: Check out repository |
43 | | - uses: actions/checkout@v3 |
| 60 | + uses: actions/checkout@v2 |
44 | 61 | - name: Run infracost diff |
45 | 62 | uses: infracost/infracost-gh-action@master |
46 | 63 | env: |
47 | 64 | INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }} |
48 | 65 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
49 | 66 | with: |
50 | | - path: examples/test |
| 67 | + path: ${{ matrix.dir }} |
0 commit comments