Skip to content

Commit 6040c12

Browse files
Merge remote-tracking branch 'origin/main' into feature/CCM-12997
2 parents a8fa07e + 82cf3b2 commit 6040c12

29 files changed

+16448
-16190
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ generated_code = true
7070

7171
[/internal/events/**/*.schema.json]
7272
insert_final_newline = unset
73+
74+
[/pact-contracts/pacts/**/*.json]
75+
insert_final_newline = unset
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'npm install and setup'
2+
description: 'Setup node, authenticate github package repository and perform clean npm install'
3+
4+
inputs:
5+
node-version:
6+
description: 'Node.js version'
7+
required: true
8+
GITHUB_TOKEN:
9+
description: "Token for access to github package registry"
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: 'Use Node.js'
16+
uses: actions/setup-node@v6
17+
with:
18+
node-version: '${{ inputs.node-version }}'
19+
registry-url: 'https://npm.pkg.github.com'
20+
scope: '@nhsdigital'
21+
22+
- name: 'Install dependencies'
23+
shell: bash
24+
env:
25+
NODE_AUTH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
26+
run: |
27+
npm ci

.github/workflows/pr_destroy_dynamic_env.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: PR Destroy Environment
33
on:
44
pull_request:
55
types: [closed]
6+
branches:
7+
- '*'
68

79
concurrency:
810
group: ${{ github.workflow }}-${{ github.ref }}

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

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ jobs:
6363
restore-keys: |
6464
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
6565
- name: "Repo setup"
66-
env:
67-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
run: |
69-
npm ci
66+
uses: ./.github/actions/node-install
67+
with:
68+
node-version: ${{ inputs.nodejs_version }}
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070
- name: "Generate dependencies"
7171
run: |
7272
npm run generate-dependencies --workspaces --if-present
@@ -92,10 +92,10 @@ jobs:
9292
restore-keys: |
9393
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
9494
- name: "Repo setup"
95-
env:
96-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
run: |
98-
npm ci
95+
uses: ./.github/actions/node-install
96+
with:
97+
node-version: ${{ inputs.nodejs_version }}
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9999
- name: "Generate dependencies"
100100
run: |
101101
npm run generate-dependencies --workspaces --if-present
@@ -114,6 +114,37 @@ jobs:
114114
with:
115115
name: code-coverage-report
116116
path: ".reports/lcov.info"
117+
test-pact:
118+
name: "Pact tests"
119+
runs-on: ubuntu-latest
120+
timeout-minutes: 5
121+
env:
122+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
permissions:
124+
packages: write
125+
contents: read
126+
steps:
127+
- name: "Checkout code"
128+
uses: actions/checkout@v5
129+
- name: "Cache node_modules"
130+
uses: actions/cache@v4
131+
with:
132+
path: |
133+
**/node_modules
134+
key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
135+
restore-keys: |
136+
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
137+
- name: "Repo setup"
138+
uses: ./.github/actions/node-install
139+
with:
140+
node-version: ${{ inputs.nodejs_version }}
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
- name: "Generate dependencies"
143+
run: npm run generate-dependencies --workspaces --if-present
144+
- name: "Run PACT tests"
145+
run: npm run test:pact --workspace tests
146+
- name: Publish Pact Contracts
147+
run: ./scripts/publish-pact-contracts.sh
117148
test-lint:
118149
name: "Linting"
119150
runs-on: ubuntu-latest
@@ -135,10 +166,10 @@ jobs:
135166
restore-keys: |
136167
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
137168
- name: "Repo setup"
138-
env:
139-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140-
run: |
141-
npm ci
169+
uses: ./.github/actions/node-install
170+
with:
171+
node-version: ${{ inputs.nodejs_version }}
172+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142173
- name: "Generate dependencies"
143174
run: |
144175
npm run generate-dependencies --workspaces --if-present
@@ -166,10 +197,10 @@ jobs:
166197
restore-keys: |
167198
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
168199
- name: "Repo setup"
169-
env:
170-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171-
run: |
172-
npm ci
200+
uses: ./.github/actions/node-install
201+
with:
202+
node-version: ${{ inputs.nodejs_version }}
203+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173204
- name: "Generate dependencies"
174205
run: |
175206
npm run generate-dependencies --workspaces --if-present

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ dist
3232
/specification/api/components/security/security.yml
3333
/specification/api/components/parameters/authorization/authorization.yml
3434
/scripts/JWT/*.pem
35+
36+
# ignore PACTS
37+
.pacts

infrastructure/terraform/components/api/module_lambda_get_letter.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "get_letter" {
2525
handler_function_name = "getLetter"
2626
runtime = "nodejs22.x"
2727
memory = 128
28-
timeout = 5
28+
timeout = 29
2929
log_level = var.log_level
3030

3131
force_lambda_code_deploy = var.force_lambda_code_deploy

infrastructure/terraform/components/api/module_lambda_get_letter_data.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "get_letter_data" {
2525
handler_function_name = "getLetterData"
2626
runtime = "nodejs22.x"
2727
memory = 128
28-
timeout = 5
28+
timeout = 29
2929
log_level = var.log_level
3030

3131
force_lambda_code_deploy = var.force_lambda_code_deploy

infrastructure/terraform/components/api/module_lambda_get_letters.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "get_letters" {
2525
handler_function_name = "getLetters"
2626
runtime = "nodejs22.x"
2727
memory = 128
28-
timeout = 5
28+
timeout = 29
2929
log_level = var.log_level
3030

3131
force_lambda_code_deploy = var.force_lambda_code_deploy

infrastructure/terraform/components/api/module_lambda_get_status.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "get_status" {
2525
handler_function_name = "getStatus"
2626
runtime = "nodejs22.x"
2727
memory = 128
28-
timeout = 5
28+
timeout = 29
2929
log_level = var.log_level
3030

3131
force_lambda_code_deploy = var.force_lambda_code_deploy

infrastructure/terraform/components/api/module_lambda_letter_status_update.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "letter_status_update" {
2525
handler_function_name = "letterStatusUpdate"
2626
runtime = "nodejs22.x"
2727
memory = 128
28-
timeout = 5
28+
timeout = 29
2929
log_level = var.log_level
3030

3131
force_lambda_code_deploy = var.force_lambda_code_deploy

0 commit comments

Comments
 (0)