Skip to content

Commit b2e5269

Browse files
authored
Merge branch 'main' into feature/CCM-13428-trigger-proxy-deploy
2 parents b06392a + 313bff3 commit b2e5269

40 files changed

+16321
-16257
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
@@ -58,10 +58,10 @@ jobs:
5858
restore-keys: |
5959
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
6060
- name: "Repo setup"
61-
env:
62-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
run: |
64-
npm ci
61+
uses: ./.github/actions/node-install
62+
with:
63+
node-version: ${{ inputs.nodejs_version }}
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6565
- name: "Generate dependencies"
6666
run: |
6767
npm run generate-dependencies --workspaces --if-present
@@ -82,10 +82,10 @@ jobs:
8282
restore-keys: |
8383
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
8484
- name: "Repo setup"
85-
env:
86-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
run: |
88-
npm ci
85+
uses: ./.github/actions/node-install
86+
with:
87+
node-version: ${{ inputs.nodejs_version }}
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8989
- name: "Generate dependencies"
9090
run: |
9191
npm run generate-dependencies --workspaces --if-present
@@ -104,6 +104,37 @@ jobs:
104104
with:
105105
name: code-coverage-report
106106
path: ".reports/lcov.info"
107+
test-pact:
108+
name: "Pact tests"
109+
runs-on: ubuntu-latest
110+
timeout-minutes: 5
111+
env:
112+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
permissions:
114+
packages: write
115+
contents: read
116+
steps:
117+
- name: "Checkout code"
118+
uses: actions/checkout@v5
119+
- name: "Cache node_modules"
120+
uses: actions/cache@v4
121+
with:
122+
path: |
123+
**/node_modules
124+
key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
125+
restore-keys: |
126+
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
127+
- name: "Repo setup"
128+
uses: ./.github/actions/node-install
129+
with:
130+
node-version: ${{ inputs.nodejs_version }}
131+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132+
- name: "Generate dependencies"
133+
run: npm run generate-dependencies --workspaces --if-present
134+
- name: "Run PACT tests"
135+
run: npm run test:pact --workspace tests
136+
- name: Publish Pact Contracts
137+
run: ./scripts/publish-pact-contracts.sh
107138
test-lint:
108139
name: "Linting"
109140
runs-on: ubuntu-latest
@@ -120,10 +151,10 @@ jobs:
120151
restore-keys: |
121152
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
122153
- name: "Repo setup"
123-
env:
124-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125-
run: |
126-
npm ci
154+
uses: ./.github/actions/node-install
155+
with:
156+
node-version: ${{ inputs.nodejs_version }}
157+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127158
- name: "Generate dependencies"
128159
run: |
129160
npm run generate-dependencies --workspaces --if-present
@@ -146,10 +177,10 @@ jobs:
146177
restore-keys: |
147178
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
148179
- name: "Repo setup"
149-
env:
150-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
151-
run: |
152-
npm ci
180+
uses: ./.github/actions/node-install
181+
with:
182+
node-version: ${{ inputs.nodejs_version }}
183+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153184
- name: "Generate dependencies"
154185
run: |
155186
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

.gitleaksignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ d8aaf7e033bf78fff491caa148897be266b60f67:src/src.sln:ipv4:3
1818
e12407e09151898bfd8d049d57eee9db9977d56b:.github/copilot-instructions.md:generic-api-key:213
1919
4ad86108d4e08cd410061e8842dd3a2b3bee4867:scripts/JWT/README.md:generic-api-key:38
2020
504844c9838740c8c5235024919f0775ad817cde:pact-contracts/pacts/letter-rendering/supplier-api-letter-request-prepared.json:generic-api-key:10
21+
82cf3b2e89ea24b97c4ffc09e618700fb1b0aff3:pact-contracts/pacts/letter-rendering/supplier-api-letter-request-prepared.json:generic-api-key:10

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

0 commit comments

Comments
 (0)