Skip to content

Commit ac6b886

Browse files
authored
Merge pull request #19 from infraspecdev/test/workflow
ci: Sepearates `Terraform docs & checks` into two workflows
2 parents 384469c + 1834e58 commit ac6b886

File tree

35 files changed

+513
-637
lines changed

35 files changed

+513
-637
lines changed
Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Terraform Docs & Checks
1+
name: Terraform Checks
22

33
on:
44
push:
@@ -11,55 +11,17 @@ on:
1111
- master
1212

1313
env:
14-
TERRAFORM_DOCS_VERSION: v0.18.0
1514
TFLINT_VERSION: v0.50.3
15+
TERRAFORM_VERSION: 1.8.4
1616

1717
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-
5418
preCommitMinVersions:
5519
name: Min TF pre-commit
56-
needs: collectInputs
5720
runs-on: ubuntu-latest
5821
strategy:
5922
matrix:
60-
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
23+
directory: ${{ fromJson(needs.setupAndTest.outputs.directories) }}
6124
steps:
62-
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
6325
- name: Delete huge unnecessary tools folder
6426
run: |
6527
rm -rf /opt/hostedtoolcache/CodeQL
@@ -77,7 +39,6 @@ jobs:
7739
directory: ${{ matrix.directory }}
7840

7941
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
80-
# Run only validate pre-commit check on min version supported
8142
if: ${{ matrix.directory != '.' }}
8243
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
8344
with:
@@ -86,7 +47,6 @@ jobs:
8647
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
8748

8849
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
89-
# Run only validate pre-commit check on min version supported
9050
if: ${{ matrix.directory == '.' }}
9151
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
9252
with:
@@ -97,9 +57,7 @@ jobs:
9757
preCommitMaxVersion:
9858
name: Max TF pre-commit
9959
runs-on: ubuntu-latest
100-
needs: collectInputs
10160
steps:
102-
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
10361
- name: Delete huge unnecessary tools folder
10462
run: |
10563
rm -rf /opt/hostedtoolcache/CodeQL
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Terraform Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
env:
14+
TERRAFORM_DOCS_VERSION: v0.18.0
15+
16+
jobs:
17+
generateDocs:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.pull_request.head.ref }}
24+
25+
- name: Render and Push terraform docs for main and modules
26+
uses: terraform-docs/gh-actions@main
27+
with:
28+
working-dir: .
29+
git-push: true
30+
config-file: .terraform-docs.yaml
31+
32+
- name: Render and Push terraform docs for examples
33+
uses: terraform-docs/gh-actions@main
34+
with:
35+
working-dir: .
36+
git-push: true
37+
config-file: .terraform-docs-example.yaml

examples/assign-users-and-groups-to-account/locals.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/assign-users-and-groups-to-account/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
locals {
2+
aws_region = "us-east-1"
3+
}
4+
15
module "account_perimissions_assignment" {
26
source = "../../modules/account_users_and_groups_assignments"
37

examples/create-member-account/locals.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/create-member-account/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
locals {
2+
aws_region = "ap-south-1"
3+
account_name = ""
4+
account_email = ""
5+
}
6+
17
module "billing_access_member_account" {
28
source = "../../modules/account/"
39

examples/create-organization/locals.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/create-organization/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
locals {
2+
aws_region = "ap-south-1"
3+
aws_organizations_feature_set = "ALL"
4+
aws_organizations_enabled_policy_types = []
5+
aws_organizations_aws_service_access_principals = []
6+
}
7+
18
module "service_integration_enabled_org" {
29
source = "../../"
310

examples/create-organizational-unit/locals.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/create-organizational-unit/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
locals {
2+
aws_region = "ap-south-1"
3+
organizational_unit_name = "Production"
4+
parent_ou_id = "ou-abcd-abcdefgh"
5+
}
6+
17
module "production_ou" {
28
source = "../../modules/organizational_unit/"
39

0 commit comments

Comments
 (0)