@@ -12,6 +12,7 @@ permissions:
1212
1313jobs :
1414 set_workspace :
15+ name : Set Workspace (ndrd)
1516 runs-on : ubuntu-latest
1617 outputs :
1718 workspace : ${{ steps.set-output.outputs.workspace }}
2021 id : set-output
2122 run : echo 'workspace=ndrd' >> $GITHUB_OUTPUT
2223
23- terraform_process :
24+ terraform_plan_apply :
25+ name : Terraform Plan/Apply (ndrd)
2426 runs-on : ubuntu-latest
2527 environment : development
2628 needs : ['set_workspace']
@@ -38,68 +40,66 @@ jobs:
3840 aws-region : ${{ vars.AWS_REGION }}
3941 mask-aws-account-id : true
4042
41- - name : View AWS Role
42- run : aws sts get-caller-identity
43-
4443 - name : Setup Terraform
4544 uses : hashicorp/setup-terraform@v3
4645 with :
4746 terraform_version : 1.13.3
4847 terraform_wrapper : false
4948
50- - name : Terraform Init
49+ - name : Initialise Terraform
5150 id : init
5251 run : terraform init -backend-config=backend.conf
5352 working-directory : ./infrastructure
5453 shell : bash
5554
56- - name : Terraform Set Workspace
55+ - name : Select Terraform Workspace
5756 id : workspace
5857 run : terraform workspace select -or-create ${{ needs.set_workspace.outputs.workspace }}
5958 working-directory : ./infrastructure
6059 shell : bash
6160
62- - name : Terraform Format
61+ - name : Check Terraform Formatting
6362 run : terraform fmt -check
6463 working-directory : ./infrastructure
6564
66- - name : Terraform Plan
65+ - name : Run Terraform Plan
6766 id : plan
6867 run : |
6968 terraform plan -input=false -no-color -var-file="${{vars.TF_VARS_FILE}}" -out tf.plan
7069 working-directory : ./infrastructure
7170 shell : bash
7271
73- - name : Terraform Apply
72+ - name : Run Terraform Apply
7473 run : terraform apply -auto-approve -input=false tf.plan
7574 working-directory : ./infrastructure
7675
77- lambda_test_job :
76+ run_lambda_unit_tests :
7877 name : Run Lambda Unit Tests
7978 uses : nhsconnect/national-document-repository/.github/workflows/base-lambdas-reusable-test.yml@main
8079 with :
8180 python_version : " 3.11"
8281 build_branch : main
8382
84- react_testing_job :
83+ run_ui_unit_tests :
8584 name : Run UI Unit Tests
8685 uses : nhsconnect/national-document-repository/.github/workflows/base-vitest-test.yml@main
8786 with :
8887 build_branch : main
8988
90- cypress-run-job :
89+ run_cypress_tests :
90+ name : Run Cypress Tests
9191 runs-on : ubuntu-22.04
9292 steps :
9393 - name : Checkout
9494 uses : actions/checkout@v5
9595 with :
9696 repository : nhsconnect/national-document-repository
9797
98- - name : Cypress install
98+ - name : npm install
9999 run : npm install --legacy-peer-deps
100100 working-directory : ./app
101101
102- - name : Configure React environment vars
102+ - name : Configure React Environment Vars
103103 env :
104104 ENDPOINT_DOC_STORE_API : http://localhost:3000
105105 AWS_REGION : test region
@@ -112,18 +112,18 @@ jobs:
112112 ./react-environment-config.sh
113113 working-directory : ./app
114114
115- - name : Cypress build
115+ - name : Cypress Build
116116 uses : cypress-io/github-action@v6
117117 with :
118118 install : false
119119 runTests : false
120120 build : npm run build
121121 working-directory : ./app
122122
123- - name : Install NPM serve
123+ - name : npm install serve -g
124124 run : npm install serve -g
125125
126- - name : Cypress run
126+ - name : Run Cypress Tests (Chrome)
127127 uses : cypress-io/github-action@v6
128128 with :
129129 install : false
@@ -134,23 +134,25 @@ jobs:
134134 CYPRESS_BASE_URL : http://localhost:3000
135135 CYPRESS_grepTags : ' regression'
136136
137- - uses : actions/upload-artifact@v4
137+ - name : Upload Artifacts (Screenshots)
138+ uses : actions/upload-artifact@v4
138139 if : failure()
139140 with :
140141 name : cypress-screenshots-chrome
141142 path : /home/runner/work/national-document-repository/national-document-repository/app/cypress/screenshots
142143 if-no-files-found : ignore
143-
144- - uses : actions/upload-artifact@v4
144+
145+ - name : Upload Artifacts (Videos)
146+ uses : actions/upload-artifact@v4
145147 if : failure()
146148 with :
147149 name : cypress-videos-chrome
148150 path : /home/runner/work/national-document-repository/national-document-repository/app/cypress/videos
149151 if-no-files-found : ignore
150152
151- publish_all_lambda_layers :
152- name : Publish all Lambda Layers
153- needs : ['set_workspace', 'terraform_process ']
153+ publish_lambda_layers :
154+ name : Publish Lambda Layers
155+ needs : ['set_workspace', 'terraform_plan_apply ']
154156 uses : nhsconnect/national-document-repository/.github/workflows/base-lambda-layer-reusable-publish-all.yml@main
155157 with :
156158 build_branch : main
@@ -160,10 +162,10 @@ jobs:
160162 secrets :
161163 AWS_ASSUME_ROLE : ${{ secrets.AWS_ASSUME_ROLE }}
162164
163- deploy_all_lambdas :
164- name : Deploy all Lambdas
165+ deploy_lambdas :
166+ name : Deploy Lambdas
165167 uses : nhsconnect/national-document-repository/.github/workflows/base-lambdas-reusable-deploy-all.yml@main
166- needs : ['set_workspace', 'publish_all_lambda_layers ']
168+ needs : ['set_workspace', 'publish_lambda_layers ']
167169 with :
168170 build_branch : main
169171 sandbox : ${{ needs.set_workspace.outputs.workspace }}
@@ -176,7 +178,7 @@ jobs:
176178 deploy_ui :
177179 name : Deploy UI
178180 uses : nhsconnect/national-document-repository/.github/workflows/base-deploy-ui.yml@main
179- needs : ['terraform_process ', 'set_workspace']
181+ needs : ['terraform_plan_apply ', 'set_workspace']
180182 with :
181183 build_branch : main
182184 sandbox : ${{ needs.set_workspace.outputs.workspace }}
@@ -186,8 +188,8 @@ jobs:
186188
187189 destroy_test_environment :
188190 if : always()
189- name : Destroy the Sandbox Environment from previous job
190- needs : [ 'set_workspace', 'deploy_ui', 'deploy_all_lambdas' ]
191+ name : Destroy Sandbox (ndrd)
192+ needs : ['set_workspace', 'deploy_ui', 'deploy_lambdas' ]
191193 uses : ./.github/workflows/tear-down-sandbox.yml
192194 with :
193195 git_ref : main
0 commit comments