Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cbd5e7a
CCM-13038: initial
bhansell1 Dec 9, 2025
504844c
Merge branch 'main' of https://github.com/NHSDigital/nhs-notify-suppl…
bhansell1 Dec 9, 2025
f0686b5
CCM-13038: implement parsing on PACT consumer test
bhansell1 Dec 9, 2025
0b02f10
suppress leak warning for test data
masl2 Dec 9, 2025
ec9fb0e
Merge branch 'main' of https://github.com/NHSDigital/nhs-notify-suppl…
bhansell1 Dec 10, 2025
9b333c2
CCM-13038: generate correct consumer pacts
bhansell1 Dec 10, 2025
ef3b7e0
Merge branch 'feature/CCM-13038_pact-tests' of https://github.com/NHS…
bhansell1 Dec 10, 2025
ad336c3
Merge branch 'main' of https://github.com/NHSDigital/nhs-notify-suppl…
bhansell1 Dec 10, 2025
376b352
CCM-13038: set GITHUB token when reading packages
bhansell1 Dec 11, 2025
81e7b57
CCM-13038: use node action
bhansell1 Dec 11, 2025
b58f81b
CCM-13038: use node action
bhansell1 Dec 11, 2025
340eb95
CCM-13038: test publish contracts on package contract change
bhansell1 Dec 11, 2025
6ea44f5
Merge branch 'main' of https://github.com/NHSDigital/nhs-notify-suppl…
bhansell1 Dec 11, 2025
edb2a8f
CCM-13038: set _authToken on gpr repo on CI
bhansell1 Dec 12, 2025
9f3b87c
CCM-13038: pass GITHUB token to action
bhansell1 Dec 12, 2025
975aecc
CCM-13038: ignore EOF lines for contracts
bhansell1 Dec 12, 2025
cf817ee
CCM-13038: use branch version of internal repo
bhansell1 Dec 12, 2025
3fac693
CCM-13038: use script in pre.sh
bhansell1 Dec 15, 2025
a706a1c
Merge branch 'main' of https://github.com/NHSDigital/nhs-notify-suppl…
bhansell1 Dec 15, 2025
51b9ad2
CCM-13038: revert back to main
bhansell1 Dec 15, 2025
8e295c2
CCM-13038: redeploy
bhansell1 Dec 16, 2025
6613450
CCM-13038: update source
bhansell1 Dec 16, 2025
e53f06a
CCM-13038: loosen restrictions on dataschema minor and patch
bhansell1 Dec 17, 2025
9dc065a
Merge branch 'main' into feature/CCM-13038_pact-tests
bhansell1 Dec 17, 2025
17f3aa9
CCM-13038: remove setup-github-token.sh from install action and use p…
bhansell1 Dec 17, 2025
02fed92
Merge branch 'feature/CCM-13038_pact-tests' of https://github.com/NHS…
bhansell1 Dec 17, 2025
cce43f8
CCM-13038: use NODE_AUTH_TOKEN for pact-test job
bhansell1 Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ generated_code = true

[/internal/events/**/*.schema.json]
insert_final_newline = unset

[/pact-contracts/pacts/**/*.json]
insert_final_newline = unset
27 changes: 27 additions & 0 deletions .github/actions/node-install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'npm install and setup'
description: 'Setup node, authenticate github package repository and perform clean npm install'

inputs:
node-version:
description: 'Node.js version'
required: true
GITHUB_TOKEN:
description: "Token for access to github package registry"
required: true

runs:
using: 'composite'
steps:
- name: 'Use Node.js'
uses: actions/setup-node@v6
with:
node-version: '${{ inputs.node-version }}'
registry-url: 'https://npm.pkg.github.com'
scope: '@nhsdigital'

- name: 'Install dependencies'
shell: bash
env:
NODE_AUTH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
run: |
npm ci
63 changes: 47 additions & 16 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
- name: "Repo setup"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Generate dependencies"
run: |
npm run generate-dependencies --workspaces --if-present
Expand All @@ -82,10 +82,10 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
- name: "Repo setup"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Generate dependencies"
run: |
npm run generate-dependencies --workspaces --if-present
Expand All @@ -104,6 +104,37 @@ jobs:
with:
name: code-coverage-report
path: ".reports/lcov.info"
test-pact:
name: "Pact tests"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
packages: write
contents: read
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Cache node_modules"
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
- name: "Repo setup"
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Generate dependencies"
run: npm run generate-dependencies --workspaces --if-present
- name: "Run PACT tests"
run: npm run test:pact --workspace tests
- name: Publish Pact Contracts
run: ./scripts/publish-pact-contracts.sh
test-lint:
name: "Linting"
runs-on: ubuntu-latest
Expand All @@ -120,10 +151,10 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
- name: "Repo setup"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Generate dependencies"
run: |
npm run generate-dependencies --workspaces --if-present
Expand All @@ -146,10 +177,10 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
- name: "Repo setup"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci
uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Generate dependencies"
run: |
npm run generate-dependencies --workspaces --if-present
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ dist
/specification/api/components/security/security.yml
/specification/api/components/parameters/authorization/authorization.yml
/scripts/JWT/*.pem

# ignore PACTS
.pacts
10 changes: 10 additions & 0 deletions infrastructure/terraform/components/api/pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
# # It ensures all Node.js dependencies are installed, generates any required dependencies,
# # and builds all Lambda functions in the workspace before Terraform provisions infrastructure.

echo "Running Pre.sh"

ROOT_DIR="$(git rev-parse --show-toplevel)"

echo "Running set-github-token.sh"

$ROOT_DIR/scripts/set-github-token.sh

echo "Completed."

npm ci

npm run generate-dependencies --workspaces --if-present
Expand Down
Loading
Loading