Skip to content

Commit cf14de2

Browse files
committed
added test tf files github action for sdo and app components
1 parent 65d4445 commit cf14de2

File tree

4 files changed

+124
-6
lines changed

4 files changed

+124
-6
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "App Components TF template tests"
2+
on:
3+
push:
4+
paths:
5+
- 'application-components/**'
6+
pull_request:
7+
paths:
8+
- 'application-components/**'
9+
10+
jobs:
11+
12+
ValidateTF:
13+
runs-on: ubuntu-latest
14+
name: "Validatation (format & syntax)"
15+
defaults:
16+
run:
17+
working-directory: ./software-development-optimization-terraform
18+
steps:
19+
- uses: actions/checkout@v4
20+
name: Checkout source code
21+
22+
- uses: hashicorp/setup-terraform@v3
23+
name: Setup Terraform
24+
25+
- name: Terraform fmt
26+
id: fmt
27+
run: terraform fmt -check -recursive -diff
28+
continue-on-error: true
29+
30+
- name: Terraform Init
31+
id: init
32+
run: terraform init
33+
34+
- name: Terraform Validate
35+
id: validate
36+
run: terraform validate
37+
38+
TFSecurityChecks:
39+
name: "Security Checks (checkov)"
40+
runs-on: "ubuntu-latest"
41+
steps:
42+
- name: Checkout repo
43+
uses: actions/checkout@v3
44+
45+
- uses: bridgecrewio/checkov-action@master
46+
with:
47+
directory: 'software-development-optimization-terraform/'
48+
quiet: true
49+
framework: terraform
50+
output_format: cli
51+
output_bc_ids: false
52+
download_external_modules: true
53+
skip_check: CKV_AWS_18,CKV_AWS_21,CKV_AWS_26,CKV_AWS_27,CKV_AWS_35,CKV_AWS_36,CKV_AWS_50,CKV_AWS_67,CKV_AWS_115,CKV_AWS_117,CKV_AWS_124,CKV_AWS_144,CKV_AWS_145,CKV_AWS_158,CKV_AWS_173,CKV_AWS_240,CKV_AWS_241,CKV_AWS_252,CKV_AWS_272,CKV_AWS_338,CKV2_AWS_6,CKV2_AWS_10,CKV2_AWS_61,CKV2_AWS_62,CKV_TF_1,CKV_TF_2

.github/workflows/cf-test.yml renamed to .github/workflows/awso-cf-test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: "CF template tests"
2-
on: [workflow_dispatch, pull_request]
1+
name: "AWSO CF template tests"
2+
on:
3+
push:
4+
paths:
5+
- 'aws-observability/**'
6+
pull_request:
7+
paths:
8+
- 'aws-observability/**'
39

410
jobs:
511
ValidateLinting:
@@ -14,7 +20,7 @@ jobs:
1420

1521
- name: Print the Cloud Formation Linter Version & run Linter.
1622
run: |
17-
cfn-lint aws-observability/**/*.yaml --ignore-templates aws-observability/**/*TestTemplate.yaml --ignore-checks W3011
23+
cfn-lint aws-observability/**/*.yaml --ignore-templates aws-observability/**/*TestTemplate.yaml --ignore-checks W3011,E8001
1824
1925
CFSecurityChecksCheckovt:
2026
name: "Security Checks (checkov)"
@@ -47,4 +53,4 @@ jobs:
4753
- name: Validate with cfn_nag
4854
run: |
4955
cfn_nag_scan -i aws-observability --ignore-fatal aws-observability/**/TestTemplate.yaml
50-
continue-on-error: true
56+
continue-on-error: true

.github/workflows/tf-test.yml renamed to .github/workflows/awso-tf-test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
name: "TF template tests"
2-
on: [workflow_dispatch, pull_request]
1+
name: "AWSO TF template tests"
2+
on:
3+
push:
4+
paths:
5+
- 'aws-observability-terraform/**'
6+
pull_request:
7+
paths:
8+
- 'aws-observability-terraform/**'
39

410
jobs:
511

.github/workflows/sdo-tf-test.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "SDO TF template tests"
2+
on:
3+
push:
4+
paths:
5+
- 'software-development-optimization-terraform/**'
6+
pull_request:
7+
paths:
8+
- 'software-development-optimization-terraform/**'
9+
10+
jobs:
11+
12+
ValidateTF:
13+
runs-on: ubuntu-latest
14+
name: "Validatation (format & syntax)"
15+
defaults:
16+
run:
17+
working-directory: ./software-development-optimization-terraform
18+
steps:
19+
- uses: actions/checkout@v4
20+
name: Checkout source code
21+
22+
- uses: hashicorp/setup-terraform@v3
23+
name: Setup Terraform
24+
25+
- name: Terraform fmt
26+
id: fmt
27+
run: terraform fmt -check -recursive -diff
28+
continue-on-error: true
29+
30+
- name: Terraform Init
31+
id: init
32+
run: terraform init
33+
34+
- name: Terraform Validate
35+
id: validate
36+
run: terraform validate
37+
38+
TFSecurityChecks:
39+
name: "Security Checks (checkov)"
40+
runs-on: "ubuntu-latest"
41+
steps:
42+
- name: Checkout repo
43+
uses: actions/checkout@v3
44+
45+
- uses: bridgecrewio/checkov-action@master
46+
with:
47+
directory: 'software-development-optimization-terraform/'
48+
quiet: true
49+
framework: terraform
50+
output_format: cli
51+
output_bc_ids: false
52+
download_external_modules: true
53+
skip_check: CKV_AWS_18,CKV_AWS_21,CKV_AWS_26,CKV_AWS_27,CKV_AWS_35,CKV_AWS_36,CKV_AWS_50,CKV_AWS_67,CKV_AWS_115,CKV_AWS_117,CKV_AWS_124,CKV_AWS_144,CKV_AWS_145,CKV_AWS_158,CKV_AWS_173,CKV_AWS_240,CKV_AWS_241,CKV_AWS_252,CKV_AWS_272,CKV_AWS_338,CKV2_AWS_6,CKV2_AWS_10,CKV2_AWS_61,CKV2_AWS_62,CKV_TF_1,CKV_TF_2

0 commit comments

Comments
 (0)