Skip to content

Commit 0bee14f

Browse files
Chore: [AEA-0000] - fix combined common workflows (#2861)
## Summary - 🤖 Operational or Infrastructure Change ### Details - chore: remove no longer req'd verify_published_from_main_image - chore: change no longer req'd runtime_docker_image -> pinned-image - chore: new get_config_values --------- Co-authored-by: anthony-nhs <121869075+anthony-nhs@users.noreply.github.com> Co-authored-by: Anthony Brown <anthony.brown8@nhs.net>
1 parent a80b076 commit 0bee14f

6 files changed

Lines changed: 44 additions & 138 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,15 @@ env:
99

1010
jobs:
1111
get_config_values:
12-
runs-on: ubuntu-22.04
13-
outputs:
14-
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
15-
devcontainer_version: ${{ steps.load-config.outputs.DEVCONTAINER_VERSION }}
16-
devcontainer_image: ${{ steps.load-config.outputs.DEVCONTAINER_IMAGE }}
17-
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
20-
21-
- name: Load config value
22-
id: load-config
23-
run: |
24-
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
25-
DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json)
26-
DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json)
27-
{
28-
echo "TAG_FORMAT=$TAG_FORMAT"
29-
echo "DEVCONTAINER_IMAGE=$DEVCONTAINER_IMAGE"
30-
echo "DEVCONTAINER_VERSION=$DEVCONTAINER_VERSION"
31-
} >> "$GITHUB_OUTPUT"
12+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
13+
with:
14+
verify_published_from_main_image: true
3215

3316
quality_checks:
34-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
17+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
3518
needs: [get_config_values]
3619
with:
37-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
20+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
3821
secrets:
3922
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4023

@@ -50,28 +33,25 @@ jobs:
5033
5134
tag_release:
5235
needs: [quality_checks, get_commit_id, get_config_values]
53-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
36+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
5437
with:
5538
dry_run: true
56-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
39+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
5740
branch_name: main
5841
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
59-
verify_published_from_main_image: true
6042
secrets: inherit
6143

6244
package_code:
6345
needs: [tag_release, get_config_values]
6446
uses: ./.github/workflows/run_package_code_and_api.yml
6547
with:
66-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
67-
verify_published_from_main_image: true
48+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
6849

6950
release_dev:
7051
needs: [tag_release, package_code, get_commit_id, get_config_values]
7152
uses: ./.github/workflows/run_release_code_and_api.yml
7253
with:
73-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
74-
verify_published_from_main_image: true
54+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
7555
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
7656
STACK_NAME: psu
7757
AWS_ENVIRONMENT: dev
@@ -117,8 +97,7 @@ jobs:
11797
needs: [tag_release, package_code, get_commit_id, get_config_values]
11898
uses: ./.github/workflows/run_release_code_and_api.yml
11999
with:
120-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
121-
verify_published_from_main_image: true
100+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
122101
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}-sandbox
123102
STACK_NAME: psu-sandbox
124103
AWS_ENVIRONMENT: dev
@@ -156,8 +135,7 @@ jobs:
156135
needs: [tag_release, release_dev, package_code, get_commit_id, get_config_values]
157136
uses: ./.github/workflows/run_release_code_and_api.yml
158137
with:
159-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
160-
verify_published_from_main_image: true
138+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
161139
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
162140
STACK_NAME: psu
163141
AWS_ENVIRONMENT: qa

.github/workflows/pull_request.yml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,17 @@ jobs:
1414
secrets:
1515
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
1616
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
17-
get_config_values:
18-
runs-on: ubuntu-22.04
19-
outputs:
20-
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
21-
devcontainer_version: ${{ steps.load-config.outputs.DEVCONTAINER_VERSION }}
22-
devcontainer_image: ${{ steps.load-config.outputs.DEVCONTAINER_IMAGE }}
23-
steps:
24-
- name: Checkout code
25-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2617

27-
- name: Load config value
28-
id: load-config
29-
run: |
30-
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
31-
DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json)
32-
DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json)
33-
{
34-
echo "TAG_FORMAT=$TAG_FORMAT"
35-
echo "DEVCONTAINER_IMAGE=$DEVCONTAINER_IMAGE"
36-
echo "DEVCONTAINER_VERSION=$DEVCONTAINER_VERSION"
37-
} >> "$GITHUB_OUTPUT"
18+
get_config_values:
19+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
20+
with:
21+
verify_published_from_main_image: false
3822

3923
quality_checks:
40-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
24+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
4125
needs: [get_config_values]
4226
with:
43-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
27+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
4428
secrets:
4529
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4630

@@ -76,13 +60,12 @@ jobs:
7660

7761
tag_release:
7862
needs: [get_config_values]
79-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
63+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
8064
with:
8165
dry_run: true
82-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
66+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
8367
branch_name: ${{ github.event.pull_request.head.ref }}
8468
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
85-
verify_published_from_main_image: false
8669
secrets: inherit
8770

8871
get_commit_id:
@@ -99,15 +82,13 @@ jobs:
9982
needs: [get_issue_number, get_config_values]
10083
uses: ./.github/workflows/run_package_code_and_api.yml
10184
with:
102-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
103-
verify_published_from_main_image: false
85+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
10486

10587
release_code:
10688
needs: [get_issue_number, package_code, get_commit_id, get_config_values]
10789
uses: ./.github/workflows/run_release_code_and_api.yml
10890
with:
109-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
110-
verify_published_from_main_image: false
91+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
11192
STACK_NAME: psu-pr-${{needs.get_issue_number.outputs.issue_number}}
11293
ARTIFACT_BUCKET_PREFIX: PR-${{needs.get_issue_number.outputs.issue_number}}
11394
AWS_ENVIRONMENT: dev
@@ -151,8 +132,7 @@ jobs:
151132
needs: [get_issue_number, package_code, get_commit_id, get_config_values]
152133
uses: ./.github/workflows/run_release_code_and_api.yml
153134
with:
154-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
155-
verify_published_from_main_image: false
135+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
156136
STACK_NAME: psu-pr-${{needs.get_issue_number.outputs.issue_number}}-sandbox
157137
ARTIFACT_BUCKET_PREFIX: PR-${{needs.get_issue_number.outputs.issue_number}}-sandbox
158138
AWS_ENVIRONMENT: dev

.github/workflows/release.yml

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,14 @@ env:
88

99
jobs:
1010
get_config_values:
11-
runs-on: ubuntu-22.04
12-
outputs:
13-
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
14-
devcontainer_version: ${{ steps.load-config.outputs.DEVCONTAINER_VERSION }}
15-
devcontainer_image: ${{ steps.load-config.outputs.DEVCONTAINER_IMAGE }}
16-
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
19-
20-
- name: Load config value
21-
id: load-config
22-
run: |
23-
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
24-
DEVCONTAINER_IMAGE=$(jq -r '.build.args.IMAGE_NAME' .devcontainer/devcontainer.json)
25-
DEVCONTAINER_VERSION=$(jq -r '.build.args.IMAGE_VERSION' .devcontainer/devcontainer.json)
26-
{
27-
echo "TAG_FORMAT=$TAG_FORMAT"
28-
echo "DEVCONTAINER_IMAGE=$DEVCONTAINER_IMAGE"
29-
echo "DEVCONTAINER_VERSION=$DEVCONTAINER_VERSION"
30-
} >> "$GITHUB_OUTPUT"
31-
11+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
12+
with:
13+
verify_published_from_main_image: true
3214
quality_checks:
33-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
15+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
3416
needs: [get_config_values]
3517
with:
36-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
18+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
3719
secrets:
3820
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3921

@@ -49,28 +31,25 @@ jobs:
4931
5032
tag_release:
5133
needs: [quality_checks, get_commit_id, get_config_values]
52-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
34+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@dac60c1e29babc62013e7bb9ade002cb381c4c49
5335
with:
5436
dry_run: false
55-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
37+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
5638
branch_name: main
5739
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
58-
verify_published_from_main_image: true
5940
secrets: inherit
6041

6142
package_code:
6243
needs: [tag_release, get_config_values]
6344
uses: ./.github/workflows/run_package_code_and_api.yml
6445
with:
65-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
66-
verify_published_from_main_image: true
46+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
6747

6848
release_dev:
6949
needs: [tag_release, package_code, get_commit_id, get_config_values]
7050
uses: ./.github/workflows/run_release_code_and_api.yml
7151
with:
72-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
73-
verify_published_from_main_image: true
52+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
7453
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
7554
STACK_NAME: psu
7655
AWS_ENVIRONMENT: dev
@@ -120,8 +99,7 @@ jobs:
12099
needs: [tag_release, package_code, get_commit_id, get_config_values]
121100
uses: ./.github/workflows/run_release_code_and_api.yml
122101
with:
123-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
124-
verify_published_from_main_image: true
102+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
125103
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}-sandbox
126104
STACK_NAME: psu-sandbox
127105
AWS_ENVIRONMENT: dev
@@ -170,8 +148,7 @@ jobs:
170148
]
171149
uses: ./.github/workflows/run_release_code_and_api.yml
172150
with:
173-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
174-
verify_published_from_main_image: true
151+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
175152
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
176153
STACK_NAME: psu
177154
AWS_ENVIRONMENT: ref
@@ -222,8 +199,7 @@ jobs:
222199
]
223200
uses: ./.github/workflows/run_release_code_and_api.yml
224201
with:
225-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
226-
verify_published_from_main_image: true
202+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
227203
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
228204
STACK_NAME: psu
229205
AWS_ENVIRONMENT: qa
@@ -266,8 +242,7 @@ jobs:
266242
needs: [tag_release, release_qa, package_code, get_commit_id, get_config_values]
267243
uses: ./.github/workflows/run_release_code_and_api.yml
268244
with:
269-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
270-
verify_published_from_main_image: true
245+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
271246
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
272247
STACK_NAME: psu
273248
AWS_ENVIRONMENT: int
@@ -316,8 +291,7 @@ jobs:
316291
needs: [tag_release, release_qa, package_code, get_commit_id, get_config_values]
317292
uses: ./.github/workflows/run_release_code_and_api.yml
318293
with:
319-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
320-
verify_published_from_main_image: true
294+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
321295
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}-sandbox
322296
STACK_NAME: psu-sandbox
323297
AWS_ENVIRONMENT: int
@@ -366,8 +340,7 @@ jobs:
366340
]
367341
uses: ./.github/workflows/run_release_code_and_api.yml
368342
with:
369-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
370-
verify_published_from_main_image: true
343+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
371344
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
372345
STACK_NAME: psu
373346
AWS_ENVIRONMENT: prod

.github/workflows/run_package_code_and_api.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,15 @@ name: package code and api
33
on:
44
workflow_call:
55
inputs:
6-
runtime_docker_image:
6+
pinned_image:
77
required: true
88
type: string
9-
verify_published_from_main_image:
10-
type: boolean
11-
required: true
129

1310
jobs:
14-
verify_attestation:
15-
uses: NHSDigital/eps-common-workflows/.github/workflows/verify-attestation.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
16-
with:
17-
runtime_docker_image: "${{ inputs.runtime_docker_image }}"
18-
verify_published_from_main_image: ${{ inputs.verify_published_from_main_image }}
1911
package_code_and_api:
2012
runs-on: ubuntu-22.04
21-
needs: verify_attestation
2213
container:
23-
image: ${{ needs.verify_attestation.outputs.pinned_image }}
14+
image: ${{ inputs.pinned_image }}
2415
options: --user 1001:1001 --group-add 128
2516
defaults:
2617
run:

.github/workflows/run_regression_tests.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,18 @@ on:
1111
type: string
1212
REGRESSION_TESTS_PEM:
1313
type: string
14-
runtime_docker_image:
14+
pinned_image:
1515
type: string
1616
required: true
1717
secrets:
1818
REGRESSION_TESTS_PEM:
1919
required: true
2020

2121
jobs:
22-
verify_attestation:
23-
uses: NHSDigital/eps-common-workflows/.github/workflows/verify-attestation.yml@36677e1d6bfaa010d7b78942a1ade12fbefecb80
24-
with:
25-
runtime_docker_image: "${{ inputs.runtime_docker_image }}"
26-
verify_published_from_main_image: false
2722
run_regression_tests:
2823
runs-on: ubuntu-22.04
29-
needs: verify_attestation
3024
container:
31-
image: ${{ needs.verify_attestation.outputs.pinned_image }}
25+
image: ${{ inputs.pinned_image }}
3226
options: --user 1001:1001 --group-add 128
3327
defaults:
3428
run:

0 commit comments

Comments
 (0)