Skip to content

Commit 01b05dd

Browse files
committed
CCM-17346: Move To Shared Modules Model
1 parent b02ab0c commit 01b05dd

4 files changed

Lines changed: 40 additions & 123 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "4. PR Title Check"
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, edited]
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check-pr-title:
14+
name: "Check PR title"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: "Check PR title format"
18+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/check-pr-title-format@4e781d1d72739015821a380871aa5a66d070177c # 3.1.0
19+
with:
20+
title: ${{ github.event.pull_request.title }}

.github/workflows/stage-1-commit.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
fetch-depth: 0 # Full history is needed to scan all commits
5454
- name: "Scan secrets"
55-
uses: ./.github/actions/scan-secrets
55+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/scan-secrets@3.0.0
5656
check-file-format:
5757
name: "Check file format"
5858
runs-on: ubuntu-latest
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
fetch-depth: 0 # Full history is needed to compare branches
6565
- name: "Check file format"
66-
uses: ./.github/actions/check-file-format
66+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/check-file-format@3.0.0
6767
check-markdown-format:
6868
name: "Check Markdown format"
6969
runs-on: ubuntu-latest
@@ -74,7 +74,7 @@ jobs:
7474
with:
7575
fetch-depth: 0 # Full history is needed to compare branches
7676
- name: "Check Markdown format"
77-
uses: ./.github/actions/check-markdown-format
77+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/check-markdown-format@3.0.0
7878
terraform-docs:
7979
name: "Run terraform-docs"
8080
runs-on: ubuntu-latest
@@ -109,7 +109,7 @@ jobs:
109109
with:
110110
fetch-depth: 0 # Full history is needed to compare branches
111111
- name: "Check English usage"
112-
uses: ./.github/actions/check-english-usage
112+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/check-english-usage@3.0.0
113113
check-todo-usage:
114114
name: "Check TODO usage"
115115
runs-on: ubuntu-latest
@@ -120,7 +120,7 @@ jobs:
120120
with:
121121
fetch-depth: 0 # Full history is needed to compare branches
122122
- name: "Check TODO usage"
123-
uses: ./.github/actions/check-todo-usage
123+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/check-todo-usage@3.0.0
124124
detect-terraform-changes:
125125
name: "Detect Terraform Changes"
126126
runs-on: ubuntu-latest
@@ -156,7 +156,7 @@ jobs:
156156
- name: "Setup ASDF"
157157
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
158158
- name: "Lint Terraform"
159-
uses: ./.github/actions/lint-terraform
159+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/lint-terraform@3.0.0
160160
#TODO - Re-visit Trivy usage https://nhsd-jira.digital.nhs.uk/browse/CCM-15549
161161
# trivy-iac:
162162
# name: "Trivy IaC Scan"
@@ -172,7 +172,7 @@ jobs:
172172
# - name: "Setup ASDF"
173173
# uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
174174
# - name: "Trivy IaC Scan"
175-
# uses: ./.github/actions/trivy-iac
175+
# uses: NHSDigital/nhs-notify-shared-modules/.github/actions/trivy-iac@3.0.0
176176
# trivy-package:
177177
# if: ${{ !inputs.skip_trivy_package }}
178178
# name: "Trivy Package Scan"
@@ -186,7 +186,7 @@ jobs:
186186
# - name: "Setup ASDF"
187187
# uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
188188
# - name: "Trivy Package Scan"
189-
# uses: ./.github/actions/trivy-package
189+
# uses: NHSDigital/nhs-notify-shared-modules/.github/actions/trivy-package@3.0.0
190190
count-lines-of-code:
191191
name: "Count lines of code"
192192
runs-on: ubuntu-latest
@@ -198,7 +198,7 @@ jobs:
198198
- name: "Checkout code"
199199
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
200200
- name: "Count lines of code"
201-
uses: ./.github/actions/create-lines-of-code-report
201+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/create-lines-of-code-report@3.0.0
202202
with:
203203
build_datetime: "${{ inputs.build_datetime }}"
204204
build_timestamp: "${{ inputs.build_timestamp }}"
@@ -217,7 +217,7 @@ jobs:
217217
- name: "Checkout code"
218218
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
219219
- name: "Scan dependencies"
220-
uses: ./.github/actions/scan-dependencies
220+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/scan-dependencies@3.0.0
221221
with:
222222
build_datetime: "${{ inputs.build_datetime }}"
223223
build_timestamp: "${{ inputs.build_timestamp }}"

.github/workflows/stage-2-test.yaml

Lines changed: 9 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ on:
1919
description: "Node.js version, set by the CI/CD pipeline workflow"
2020
required: true
2121
type: string
22-
pnpm_version:
23-
description: "pnpm version, set by the CI/CD pipeline workflow"
24-
required: true
25-
type: string
2622
python_version:
2723
description: "Python version, set by the CI/CD pipeline workflow"
2824
required: true
@@ -36,136 +32,41 @@ on:
3632
required: true
3733
type: string
3834

39-
env:
40-
AWS_REGION: eu-west-2
41-
TERM: xterm-256color
42-
43-
permissions:
44-
contents: read # This is required for actions/checkout
45-
4635
jobs:
47-
check-generated-dependencies:
48-
name: "Check generated dependencies"
49-
runs-on: ubuntu-latest
50-
timeout-minutes: 5
51-
steps:
52-
- name: "Checkout code"
53-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
54-
- name: "Setup pnpm"
55-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
56-
with:
57-
version: "${{ inputs.pnpm_version }}"
58-
cache: true
59-
- name: "Use Node.js"
60-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
61-
with:
62-
node-version-file: '.tool-versions'
63-
cache: 'pnpm'
64-
- name: "Repo setup"
65-
run: |
66-
pnpm install --frozen-lockfile
67-
- name: "Generate dependencies"
68-
run: |
69-
pnpm run generate-dependencies
70-
git diff --exit-code
7136
test-unit:
7237
name: "Unit tests"
7338
runs-on: ubuntu-latest
7439
timeout-minutes: 5
7540
steps:
7641
- name: "Checkout code"
77-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
78-
- name: "Setup pnpm"
79-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
80-
with:
81-
version: "${{ inputs.pnpm_version }}"
82-
cache: true
83-
- name: "Use Node.js"
84-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
85-
with:
86-
node-version-file: '.tool-versions'
87-
cache: 'pnpm'
88-
- name: "Repo setup"
89-
run: |
90-
pnpm install --frozen-lockfile
91-
- name: "Generate dependencies"
92-
run: |
93-
pnpm run generate-dependencies
42+
uses: actions/checkout@v4
9443
- name: "Run unit test suite"
9544
run: |
9645
make test-unit
9746
- name: "Save the result of fast test suite"
98-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
99-
with:
100-
name: unit-tests
101-
path: "**/.reports/unit"
102-
include-hidden-files: true
103-
if: always()
104-
- name: "Save the result of code coverage"
105-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
106-
with:
107-
name: code-coverage-report
108-
path: ".reports/lcov.info"
47+
run: |
48+
echo "Nothing to save"
10949
test-lint:
11050
name: "Linting"
11151
runs-on: ubuntu-latest
11252
timeout-minutes: 5
11353
steps:
11454
- name: "Checkout code"
115-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
116-
- name: "Setup pnpm"
117-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
118-
with:
119-
version: "${{ inputs.pnpm_version }}"
120-
cache: true
121-
- name: "Use Node.js"
122-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
123-
with:
124-
node-version-file: '.tool-versions'
125-
cache: 'pnpm'
126-
- name: "Repo setup"
127-
run: |
128-
pnpm install --frozen-lockfile
129-
- name: "Generate dependencies"
130-
run: |
131-
pnpm run generate-dependencies
55+
uses: actions/checkout@v4
13256
- name: "Run linting"
13357
run: |
13458
make test-lint
135-
test-typecheck:
136-
name: "Typecheck"
137-
runs-on: ubuntu-latest
138-
timeout-minutes: 5
139-
steps:
140-
- name: "Checkout code"
141-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
142-
- name: "Setup pnpm"
143-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
144-
with:
145-
version: "${{ inputs.pnpm_version }}"
146-
cache: true
147-
- name: "Use Node.js"
148-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
149-
with:
150-
node-version-file: '.tool-versions'
151-
cache: 'pnpm'
152-
- name: "Repo setup"
59+
- name: "Save the linting result"
15360
run: |
154-
pnpm install --frozen-lockfile
155-
- name: "Generate dependencies"
156-
run: |
157-
pnpm run generate-dependencies
158-
- name: "Run typecheck"
159-
run: |
160-
make test-typecheck
61+
echo "Nothing to save"
16162
test-coverage:
16263
name: "Test coverage"
16364
needs: [test-unit]
16465
runs-on: ubuntu-latest
16566
timeout-minutes: 5
16667
steps:
16768
- name: "Checkout code"
168-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
69+
uses: actions/checkout@v4
16970
- name: "Run test coverage check"
17071
run: |
17172
make test-coverage
@@ -182,15 +83,11 @@ jobs:
18283
timeout-minutes: 5
18384
steps:
18485
- name: "Checkout code"
185-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
86+
uses: actions/checkout@v4
18687
with:
18788
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
188-
- name: "Download coverage report for SONAR"
189-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
190-
with:
191-
name: code-coverage-report
19289
- name: "Perform static analysis"
193-
uses: ./.github/actions/perform-static-analysis
90+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/perform-static-analysis@3.0.0
19491
with:
19592
sonar_organisation_key: "${{ vars.SONAR_ORGANISATION_KEY }}"
19693
sonar_project_key: "${{ vars.SONAR_PROJECT_KEY }}"

.github/workflows/stage-3-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
version: "${{ inputs.pnpm_version }}"
5151
cache: true
5252
- name: "Build docs"
53-
uses: ./.github/actions/build-docs
53+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/build-docs@3.0.0
5454
with:
5555
version: "${{ inputs.version }}"
5656
artefact-1:

0 commit comments

Comments
 (0)