Skip to content

Merge pull request #51 from RossBugginsNHS/copilot/fix-version-not-sh… #2

Merge pull request #51 from RossBugginsNHS/copilot/fix-version-not-sh…

Merge pull request #51 from RossBugginsNHS/copilot/fix-version-not-sh… #2

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
jobs:
quality:
name: Build, Lint, Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm test
terraform-validate:
name: Terraform Validate
runs-on: ubuntu-latest
needs: quality
permissions:
contents: read
strategy:
fail-fast: false
matrix:
environment: [dev, prod]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
- name: Terraform Init
working-directory: infrastructure/terraform/environments/${{ matrix.environment }}
run: |
cat > backend_override.tf << 'EOF'
terraform {
backend "local" {}
}
EOF
terraform init -reconfigure
- name: Terraform Validate
working-directory: infrastructure/terraform/environments/${{ matrix.environment }}
run: terraform validate
terraform-test:
name: Terraform Test
runs-on: ubuntu-latest
needs: quality
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
- name: Terraform Init
working-directory: infrastructure/terraform/modules/dispatcher_service
run: terraform init -backend=false
- name: Terraform Test
working-directory: infrastructure/terraform/modules/dispatcher_service
run: terraform test