1- name : CI
1+ name : CI / IaC
22
33on :
44 pull_request :
55 branches : [dev, stg, prd]
66 types : [opened, reopened, synchronize, edited]
7- paths-ignore :
8- - ' README.md '
9- - ' LICENSE '
10- - ' .gitignore '
7+ paths :
8+ - ' terraform-iac/** '
9+ - ' .github/workflows/ci-iac.yml '
10+
1111env :
1212 node_version : " 22.x"
1313 tf_version : " 1.9.8" # must match value in terraform-iac/*/app/main.tf
14- FORCE_COLOR : 3
1514
1615jobs :
1716 env :
@@ -55,12 +54,12 @@ jobs:
5554 {
5655 "tf_working_dir":"./terraform-iac/prd/app",
5756 "aws_account":"539738229445",
58- "aws_gha_role":"hw-lambda-api-prd -gha"
57+ "aws_gha_role":"hw-lambda-api-cpy -gha"
5958 },
6059 {
6160 "tf_working_dir":"./terraform-iac/cpy/app",
6261 "aws_account":"539738229445",
63- "aws_gha_role":"hw-lambda-api-cpy -gha"
62+ "aws_gha_role":"hw-lambda-api-prd -gha"
6463 }
6564 ]
6665 }'
@@ -69,82 +68,10 @@ jobs:
6968 outputs :
7069 matrix : ${{ env.matrix }}
7170
72- test :
73- name : Test
74- runs-on : ubuntu-latest
75- timeout-minutes : 3
76- steps :
77- - uses : actions/checkout@v4
78-
79- - name : Set up Node.js
80- uses : actions/setup-node@v4
81- with :
82- node-version : ${{ env.node_version }}
83- cache : npm
84- cache-dependency-path : ' **/package-lock.json'
85-
86- - name : npm ci
87- working-directory : src
88- run : npm ci --prefer-offline
89-
90- - name : npm test
91- working-directory : src
92- run : npm test
93-
94- - name : Report test coverage to Codecov
95- uses : codecov/codecov-action@v5
96- if : env.CODECOV_TOKEN
97- env :
98- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
99-
100- audit :
101- name : Audit
102- runs-on : ubuntu-latest
103- timeout-minutes : 3
104- steps :
105- - uses : actions/checkout@v4
106-
107- - name : Set up Node.js
108- uses : actions/setup-node@v4
109- with :
110- node-version : ${{ env.node_version }}
111-
112- # We don't need to install deps to audit them
113-
114- - name : npm audit
115- working-directory : src
116- run : npm audit --audit-level=critical
117-
118- lint :
119- name : Lint
120- runs-on : ubuntu-latest
121- timeout-minutes : 3
122- steps :
123- - uses : actions/checkout@v4
124-
125- - name : Set up Node.js
126- uses : actions/setup-node@v4
127- with :
128- node-version : ${{ env.node_version }}
129- cache : npm
130- cache-dependency-path : ' **/package-lock.json'
131-
132- - name : npm ci
133- working-directory : src
134- run : npm ci --prefer-offline
135-
136- - name : npm lint
137- working-directory : src
138- run : npm run lint
139-
14071 format :
14172 name : Terraform Format
14273 timeout-minutes : 3
14374 runs-on : ubuntu-latest
144- needs : env
145- strategy :
146- matrix : ${{ fromJson(needs.env.outputs.matrix) }}
147- fail-fast : false
14875 steps :
14976 - uses : actions/checkout@v4
15077
@@ -154,11 +81,11 @@ jobs:
15481 terraform_version : ${{ env.tf_version }}
15582
15683 - name : Terraform Format
157- working-directory : " ./ "
84+ working-directory : terraform-iac
15885 run : terraform fmt -check -recursive
15986
16087 plan :
161- name : Terraform Plan
88+ name : Terraform Plan / ${{ matrix.env.environment_name }}
16289 timeout-minutes : 6
16390 runs-on : ubuntu-latest
16491 needs : env
@@ -220,4 +147,3 @@ jobs:
220147 terraform-plan-file : plan
221148 divvycloud-username : ${{ secrets.DIVVYCLOUD_USERNAME }}
222149 divvycloud-password : ${{ secrets.DIVVYCLOUD_PASSWORD }}
223-
0 commit comments