Skip to content

Commit 68ecc23

Browse files
authored
[PRM-551] Workflow job/step names review (#451)
1 parent 88b9603 commit 68ecc23

13 files changed

+296
-343
lines changed

.github/workflows/automated-deploy-dev.yml

Lines changed: 183 additions & 190 deletions
Large diffs are not rendered by default.

.github/workflows/automated-sonarqube-cloud-analysis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ on:
66
- main
77
pull_request:
88
types: [opened, synchronize, reopened]
9+
910
permissions:
1011
contents: read
1112
pull-requests: write
1213

1314
jobs:
14-
sonarqube:
15-
name: SonarQube
15+
sonarqube_cloud:
16+
name: SonarQube Cloud Analysis
1617
runs-on: ubuntu-latest
1718
steps:
18-
- uses: actions/checkout@v5
19+
- name: Checkout
20+
uses: actions/checkout@v5
1921
with:
2022
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
21-
- name: SonarQube Scan
23+
24+
- name: SonarQube Cloud Scan
2225
uses: SonarSource/sonarqube-scan-action@v6
2326
env:
2427
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any

.github/workflows/base-cleanup-lambda-edge.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,14 @@ jobs:
3030
runs-on: ubuntu-latest
3131
environment: ${{ inputs.environment }}
3232
steps:
33-
- name: Display passed variables
34-
run: |
35-
echo Sandbox name: ${{ inputs.sandbox_name }}
36-
echo Git branch/tag/sha: ${{ inputs.git_ref }}
37-
echo Environment: ${{ inputs.environment }}
38-
3933
- name: Checkout
4034
uses: actions/checkout@v5
4135
with:
4236
repository: 'nhsconnect/national-document-repository-infrastructure'
4337
ref: ${{ inputs.git_ref }}
4438
fetch-depth: '0'
4539

46-
- name: Set up Python 3.11
40+
- name: Setup Python 3.11
4741
uses: actions/setup-python@v6
4842
with:
4943
python-version: 3.11

.github/workflows/base-cleanup-workspace.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,10 @@ permissions:
2525
contents: read # This is required for actions/checkout
2626

2727
jobs:
28-
view_action_parameters:
29-
name: View Deploy all input variables
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Display client passed variables
33-
run: |
34-
echo Sandbox name: ${{ inputs.sandbox_name }}
35-
echo Git branch/tag/sha: ${{ inputs.git_ref }}
36-
echo Environment: ${{ inputs.environment }}
37-
3828
cleanup_process:
39-
name: Run Cleanup Versions script
29+
name: Run Cleanup Versions Script
4030
runs-on: ubuntu-latest
4131
environment: ${{ inputs.environment }}
42-
4332
steps:
4433
- name: Checkout
4534
uses: actions/checkout@v5
@@ -48,12 +37,12 @@ jobs:
4837
ref: ${{ inputs.git_ref }}
4938
fetch-depth: '0'
5039

51-
- name: Set up Python 3.11
40+
- name: Setup Python 3.11
5241
uses: actions/setup-python@v6
5342
with:
5443
python-version: 3.11
5544

56-
- name: Make virtual environment
45+
- name: Make Virtual Environment
5746
run: |
5847
python3 -m venv ./venv
5948
./venv/bin/pip3 install --upgrade pip
@@ -67,6 +56,6 @@ jobs:
6756
aws-region: ${{ vars.AWS_REGION }}
6857
mask-aws-account-id: true
6958

70-
- name: Run Version Cleanup Script
59+
- name: Run Cleanup Versions Script
7160
run: |
7261
./venv/bin/python3 scripts/cleanup_versions.py ${{ inputs.sandbox_name }}

.github/workflows/cron-daily-health-check.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
jobs:
1414
set_workspace:
15+
name: Set Workspace (ndrd)
1516
runs-on: ubuntu-latest
1617
outputs:
1718
workspace: ${{ steps.set-output.outputs.workspace }}
@@ -20,7 +21,8 @@ jobs:
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

.github/workflows/cron-tear-down-sandbox.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Z-CRON: Tear down - Sandbox'
1+
name: 'Z-CRON: Tear down - Sandboxes'
22

33
on:
44
schedule:
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
destroy_process:
14-
name: Destroy Sandbox Environments
14+
name: Destroy Sandboxes
1515
runs-on: ubuntu-latest
1616
environment: development
1717
steps:
@@ -28,7 +28,7 @@ jobs:
2828
aws-region: ${{ vars.AWS_REGION }}
2929
mask-aws-account-id: true
3030

31-
- name: Set up Python
31+
- name: Setup Python 3.11
3232
uses: actions/setup-python@v6
3333
with:
3434
python-version: 3.11

.github/workflows/cron-tear-down-test.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
secrets:
2121
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
2222

23-
cleanup_versions_process:
24-
name: Cleanup Versions Process
23+
cleanup_versions:
24+
name: Cleanup Versions
2525
uses: ./.github/workflows/base-cleanup-workspace.yml
2626
with:
2727
git_ref: main
@@ -31,16 +31,15 @@ jobs:
3131
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
3232

3333
terraform_destroy_process:
34+
name: Destroy Test Environment
3435
runs-on: ubuntu-latest
3536
environment: test
36-
needs: [cleanup_versions_process]
37+
needs: [cleanup_versions]
3738
strategy:
3839
matrix:
3940
# Can't use an env var here unfortunately, we will have to update here with new sandbox environments
4041
sandbox-name: [ndr-test]
41-
4242
steps:
43-
# Checkout the repository to the GitHub Actions runner
4443
- name: Checkout
4544
uses: actions/checkout@v5
4645
with:
@@ -54,23 +53,19 @@ jobs:
5453
aws-region: ${{ vars.AWS_REGION }}
5554
mask-aws-account-id: true
5655

57-
- name: View AWS Role
58-
run: aws sts get-caller-identity
59-
60-
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
6156
- name: Setup Terraform
6257
uses: hashicorp/setup-terraform@v3
6358
with:
6459
terraform_version: 1.13.3
6560
terraform_wrapper: false
6661

67-
- name: Terraform Init
62+
- name: Initialise Terraform
6863
id: init
6964
run: terraform init -backend-config=backend-test.conf
7065
working-directory: ./infrastructure
7166
shell: bash
7267

73-
- name: Terraform Set Workspace
68+
- name: Select Terraform Workspace
7469
id: workspace
7570
run: terraform workspace select ${{ matrix.sandbox-name }}
7671
working-directory: ./infrastructure
@@ -101,7 +96,7 @@ jobs:
10196
--region eu-west-2
10297
done
10398
104-
- name: Terraform Destroy
99+
- name: Run Terraform Destroy
105100
id: destroy
106101
run: terraform destroy -auto-approve -var-file="${{ vars.TF_VARS_FILE }}"
107102
working-directory: ./infrastructure

0 commit comments

Comments
 (0)