Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/actions/acceptance-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
with:
node-version: ${{ steps.nodejs_version.outputs.nodejs_version }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
- name: "Repo setup"
- name: "Install dependencies"
shell: bash
run: |
npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ runs:
uses: ruby/setup-ruby@v1.267.0
with:
ruby-version: "3.4.7" # Not needed with a .ruby-version file
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
#cache-version: 0 # Increment this number if you need to re-download cached gems
bundler-cache: true # Enable automatic gem caching
cache-version: 0 # Increment this number if you need to re-download cached gems
working-directory: "./docs"
- name: Setup Pages
id: pages
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/node-install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ runs:
uses: actions/setup-node@v6
with:
node-version: '${{ inputs.node-version }}'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: "Configure npm for GitHub Packages"
shell: bash
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check file format"
uses: ./.github/actions/check-file-format
check-markdown-format:
Expand All @@ -66,8 +64,6 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check Markdown format"
uses: ./.github/actions/check-markdown-format
terraform-docs:
Expand Down Expand Up @@ -101,8 +97,6 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check English usage"
uses: ./.github/actions/check-english-usage
check-todo-usage:
Expand All @@ -112,8 +106,6 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check TODO usage"
uses: ./.github/actions/check-todo-usage
detect-terraform-changes:
Expand Down
52 changes: 32 additions & 20 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,34 @@ env:
TERM: xterm-256color

jobs:
detect-schema-changes:
name: "Detect Schema Changes"
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
schemas_changed: ${{ steps.filter.outputs.schemas }}
steps:
- name: "Checkout code"
uses: actions/checkout@v5

- name: "Check for schema changes"
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
schemas:
- 'src/cloudevents/**'
- 'src/typescript-schema-generator/**'
- 'src/python-schema-generator/**'
- 'src/digital-letters-events/**'

check-generated-dependencies:
name: "Check generated dependencies"
needs: [detect-schema-changes]
if: needs.detect-schema-changes.outputs.schemas_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 4
permissions:
contents: read
packages: read
Expand Down Expand Up @@ -80,6 +104,8 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python_version }}
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: "Run unit test suite"
run: |
make test-unit
Expand All @@ -106,7 +132,7 @@ jobs:
test-lint:
name: "Linting"
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 4
permissions:
contents: read
packages: read
Expand All @@ -117,6 +143,8 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python_version }}
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- uses: ./.github/actions/node-install
with:
node-version: ${{ inputs.nodejs_version }}
Expand All @@ -127,7 +155,7 @@ jobs:
test-typecheck:
name: "Typecheck"
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 4
permissions:
contents: read
packages: read
Expand All @@ -143,30 +171,14 @@ jobs:
- name: "Run typecheck"
run: |
make test-typecheck
test-coverage:
name: "Test coverage"
needs: [test-unit]
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Run test coverage check"
run: |
make test-coverage
- name: "Save the coverage check result"
run: |
echo "Nothing to save"
perform-static-analysis:
name: "Perform static analysis"
needs: [test-unit]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
timeout-minutes: 5
timeout-minutes: 4
steps:
- name: "Checkout code"
uses: actions/checkout@v5
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,45 @@ on:
type: string

jobs:
detect-doc-changes:
name: "Detect Documentation Changes"
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
docs_changed: ${{ steps.filter.outputs.docs }}
schemas_changed: ${{ steps.filter.outputs.schemas }}
eventcatalog_changed: ${{ steps.filter.outputs.eventcatalog }}
steps:
- name: "Checkout code"
uses: actions/checkout@v5

- name: "Check for relevant changes"
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docs:
- 'docs/**'
schemas:
- 'src/cloudevents/**'
- 'src/cloudeventjekylldocs/**'
eventcatalog:
- 'src/eventcatalog/**'
- 'src/asyncapigenerator/**'
- 'src/eventcatalogasyncapiimporter/**'

artefact-jekyll-docs:
name: "Build Docs"
needs: [detect-doc-changes]
if: |
needs.detect-doc-changes.outputs.docs_changed == 'true' ||
needs.detect-doc-changes.outputs.schemas_changed == 'true' ||
needs.detect-doc-changes.outputs.eventcatalog_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: "Checkout code"
uses: actions/checkout@v5
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/stage-4-acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,9 @@ on:
type: string

jobs:
environment-set-up:
name: "Environment set up"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Create infractructure"
run: |
echo "Creating infractructure..."
- name: "Update database"
run: |
echo "Updating database..."
- name: "Deploy application"
run: |
echo "Deploying application..."
test-contract:
name: "Contract test"
runs-on: ubuntu-latest
needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
Expand All @@ -55,7 +38,6 @@ jobs:
test-security:
name: "Security test"
runs-on: ubuntu-latest
needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
Expand All @@ -69,7 +51,6 @@ jobs:
test-ui:
name: "UI test"
runs-on: ubuntu-latest
needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
Expand All @@ -83,7 +64,6 @@ jobs:
test-ui-performance:
name: "UI performance test"
runs-on: ubuntu-latest
needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
Expand All @@ -97,7 +77,6 @@ jobs:
test-integration:
name: "Integration test"
runs-on: ubuntu-latest
needs: environment-set-up
steps:
- uses: actions/checkout@v5.0.0
# Calls out to the nhs-notify-internal repo.
Expand All @@ -122,7 +101,6 @@ jobs:
test-accessibility:
name: "Accessibility test"
runs-on: ubuntu-latest
needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
Expand All @@ -136,7 +114,6 @@ jobs:
test-load:
name: "Load test"
runs-on: ubuntu-latest
needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
Expand All @@ -147,24 +124,3 @@ jobs:
- name: "Save result"
run: |
echo "Nothing to save"
environment-tear-down:
name: "Environment tear down"
runs-on: ubuntu-latest
needs:
[
test-accessibility,
test-contract,
test-integration,
test-load,
test-security,
test-ui-performance,
test-ui,
]
if: always()
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Tear down environment"
run: |
echo "Tearing down environment..."
1 change: 0 additions & 1 deletion scripts/tests/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

npm ci
npm run generate-dependencies
npm run lint
Loading