Skip to content

Commit e42e1e4

Browse files
committed
LIME-1864 prefer esbuild over vite for lambda builds
- add example metrics - add example logging - remove vite config - remove makefile - enable experimental decorators in tsconfig - update deploy template to use `esbuild` build method - align GHA with FE
1 parent fbbae1a commit e42e1e4

20 files changed

Lines changed: 938 additions & 729 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Node project setup
2+
description: Checkout and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Node setup
8+
uses: actions/setup-node@v6
9+
with:
10+
node-version-file: '.nvmrc'
11+
cache: 'npm'
12+
package-manager-cache: true
13+
- name: Install dependencies
14+
run: npm ci
15+
shell: bash

.github/workflows/check-pr.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/post-merge.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Post merge
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
sonar-scan:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0 # required for sonar
18+
- name: Setup Node
19+
uses: ./.github/actions/node-setup
20+
- name: Unit tests
21+
run: npm run test:coverage
22+
- name: Sonar scan
23+
uses: SonarSource/sonarqube-scan-action@v7.0.0
24+
env:
25+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/pr-check.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: PR check
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- ready_for_review
9+
- synchronize
10+
11+
jobs:
12+
pre-commit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Pre-commit checks
16+
uses: govuk-one-login/github-actions/code-quality/run-pre-commit@3b0015c58dd0e19e1572fda59dda4184df387d1e
17+
with:
18+
package-manager: 'npm'
19+
install-dependencies: 'true'
20+
all-files: 'true'
21+
22+
type-check:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v6
29+
- name: Setup Node
30+
uses: ./.github/actions/node-setup
31+
- name: Type check
32+
run: npm run type-check
33+
34+
unit-tests:
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
needs: type-check
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v6
42+
with:
43+
fetch-depth: 0 # required for sonar
44+
- name: Setup Node
45+
uses: ./.github/actions/node-setup
46+
- name: Unit tests
47+
run: npm run test:coverage
48+
- name: Sonar scan # runs after unit tests in order to consume coverage report
49+
uses: SonarSource/sonarqube-scan-action@v7.0.0
50+
env:
51+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52+
53+
merge-status:
54+
runs-on: ubuntu-latest
55+
needs: [pre-commit, type-check, unit-tests]
56+
if: always()
57+
steps:
58+
- run: |
59+
failed=()
60+
[[ "${{ needs.pre-commit.result }}" != "success" ]] && failed+=("pre-commit")
61+
[[ "${{ needs.type-check.result }}" != "success" ]] && failed+=("type-check")
62+
[[ "${{ needs.unit-tests.result }}" != "success" ]] && failed+=("unit-tests")
63+
64+
if [[ ${#failed[@]} -gt 0 ]]; then
65+
echo "The following jobs failed: ${failed[*]}"
66+
exit 1
67+
fi

.github/workflows/run-sonar-scan.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/run-ts-style-check.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/run-unit-tests.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/run-vite-build-check.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ignore-scripts=true
2+
save-exact=true

.pre-commit-config.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,31 @@ repos:
88
- id: detect-aws-credentials
99
args: [--allow-missing-credentials]
1010
- id: detect-private-key
11-
1211
- repo: https://github.com/aws-cloudformation/cfn-lint
13-
rev: v1.43.2
12+
rev: v1.46.0
1413
hooks:
1514
- id: cfn-lint
1615
files: template\.ya?ml$
17-
1816
- repo: https://github.com/bridgecrewio/checkov.git
19-
rev: '3.2.506'
17+
rev: 3.2.506
2018
hooks:
2119
- id: checkov
22-
verbose: true
20+
files: template\.ya?ml$
2321
args: [--soft-fail]
24-
files: deploy/.*\.ya?ml$
25-
2622
- repo: https://github.com/Yelp/detect-secrets
2723
rev: v1.5.0
2824
hooks:
2925
- id: detect-secrets
3026
args: ['--baseline', '.secrets.baseline']
31-
3227
- repo: local
3328
hooks:
3429
- id: eslint
35-
name: eslint
30+
name: ESLint
3631
entry: npm run lint
3732
language: system
3833
pass_filenames: false
39-
4034
- id: prettier
41-
name: prettier
35+
name: Prettier
4236
entry: npm run format
4337
language: system
4438
pass_filenames: false

0 commit comments

Comments
 (0)