|
1 | | -name: Terraform Docs & Checks |
| 1 | +name: Terraform Checks |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
11 | 11 | - master |
12 | 12 |
|
13 | 13 | env: |
14 | | - TERRAFORM_DOCS_VERSION: v0.18.0 |
15 | 14 | TFLINT_VERSION: v0.50.3 |
| 15 | + TERRAFORM_VERSION: 1.8.4 |
16 | 16 |
|
17 | 17 | jobs: |
18 | | - generateDocs: |
19 | | - runs-on: ubuntu-latest |
20 | | - steps: |
21 | | - - name: Checkout repository |
22 | | - uses: actions/checkout@v4 |
23 | | - with: |
24 | | - ref: ${{ github.event.pull_request.head.ref }} |
25 | | - |
26 | | - - name: Render and Push terraform docs for main and modules |
27 | | - uses: terraform-docs/gh-actions@main |
28 | | - with: |
29 | | - working-dir: . |
30 | | - git-push: true |
31 | | - config-file: .terraform-docs.yaml |
32 | | - |
33 | | - - name: Render and Push terraform docs for examples |
34 | | - uses: terraform-docs/gh-actions@main |
35 | | - with: |
36 | | - working-dir: . |
37 | | - git-push: true |
38 | | - config-file: .terraform-docs-example.yaml |
39 | | - |
40 | | - collectInputs: |
41 | | - name: Collect workflow inputs |
42 | | - needs: generateDocs |
43 | | - runs-on: ubuntu-latest |
44 | | - outputs: |
45 | | - directories: ${{ steps.dirs.outputs.directories }} |
46 | | - steps: |
47 | | - - name: Checkout |
48 | | - uses: actions/checkout@v4 |
49 | | - |
50 | | - - name: Get root directories |
51 | | - id: dirs |
52 | | - uses: clowdhaus/terraform-composite-actions/directories@v1.9.0 |
53 | | - |
54 | 18 | preCommitMinVersions: |
55 | 19 | name: Min TF pre-commit |
56 | | - needs: collectInputs |
57 | 20 | runs-on: ubuntu-latest |
58 | 21 | strategy: |
59 | 22 | matrix: |
60 | | - directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} |
| 23 | + directory: ${{ fromJson(needs.setupAndTest.outputs.directories) }} |
61 | 24 | steps: |
62 | | - # https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 |
63 | 25 | - name: Delete huge unnecessary tools folder |
64 | 26 | run: | |
65 | 27 | rm -rf /opt/hostedtoolcache/CodeQL |
|
77 | 39 | directory: ${{ matrix.directory }} |
78 | 40 |
|
79 | 41 | - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} |
80 | | - # Run only validate pre-commit check on min version supported |
81 | 42 | if: ${{ matrix.directory != '.' }} |
82 | 43 | uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 |
83 | 44 | with: |
|
86 | 47 | args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' |
87 | 48 |
|
88 | 49 | - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} |
89 | | - # Run only validate pre-commit check on min version supported |
90 | 50 | if: ${{ matrix.directory == '.' }} |
91 | 51 | uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 |
92 | 52 | with: |
|
97 | 57 | preCommitMaxVersion: |
98 | 58 | name: Max TF pre-commit |
99 | 59 | runs-on: ubuntu-latest |
100 | | - needs: collectInputs |
101 | 60 | steps: |
102 | | - # https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 |
103 | 61 | - name: Delete huge unnecessary tools folder |
104 | 62 | run: | |
105 | 63 | rm -rf /opt/hostedtoolcache/CodeQL |
|
0 commit comments