Skip to content

Commit 96ade9b

Browse files
authored
Merge branch 'main' into kw/feat/sdk-296-payroll-canceled-alert
2 parents 08cf246 + c1ff97e commit 96ade9b

File tree

3 files changed

+225
-8
lines changed

3 files changed

+225
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 141 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,152 @@
11
name: CI
22
on: push
3+
4+
# Limit the permissions of the GITHUB_TOKEN
5+
permissions:
6+
contents: read
7+
38
jobs:
9+
# Setup job: Install dependencies and cache them for parallel jobs
10+
setup:
11+
runs-on:
12+
group: gusto-ubuntu-default
13+
outputs:
14+
cache-key: ${{ steps.cache-key.outputs.key }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version-file: '.nvmrc'
21+
22+
- name: Generate cache key
23+
id: cache-key
24+
run: echo "key=node-modules-${{ hashFiles('package-lock.json') }}" >> $GITHUB_OUTPUT
25+
26+
- name: Cache node_modules
27+
id: cache-node-modules
28+
uses: actions/cache@v4
29+
with:
30+
path: node_modules
31+
key: ${{ steps.cache-key.outputs.key }}
32+
33+
- name: Install dependencies
34+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
35+
run: npm ci
36+
37+
# Build job: Build the project and cache artifacts
438
build:
39+
needs: setup
40+
runs-on:
41+
group: gusto-ubuntu-default
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version-file: '.nvmrc'
48+
49+
- name: Restore node_modules cache
50+
uses: actions/cache/restore@v4
51+
with:
52+
path: node_modules
53+
key: ${{ needs.setup.outputs.cache-key }}
54+
55+
- name: Cache build artifacts
56+
id: cache-build
57+
uses: actions/cache@v4
58+
with:
59+
path: dist
60+
key: build-${{ github.sha }}
61+
62+
- name: Generate i18n translations
63+
if: steps.cache-build.outputs.cache-hit != 'true'
64+
run: npm run i18n:generate
65+
66+
- name: Build
67+
if: steps.cache-build.outputs.cache-hit != 'true'
68+
run: npx vite build
69+
70+
# Lint job: Run ESLint (parallel with other checks)
71+
lint:
72+
needs: setup
73+
runs-on:
74+
group: gusto-ubuntu-default
75+
steps:
76+
- uses: actions/checkout@v4
77+
78+
- uses: actions/setup-node@v4
79+
with:
80+
node-version-file: '.nvmrc'
81+
82+
- name: Restore node_modules cache
83+
uses: actions/cache/restore@v4
84+
with:
85+
path: node_modules
86+
key: ${{ needs.setup.outputs.cache-key }}
87+
88+
- name: Lint
89+
run: npm run lint:check
90+
91+
# Format job: Run Prettier check (parallel with other checks)
92+
format:
93+
needs: setup
594
runs-on:
695
group: gusto-ubuntu-default
796
steps:
897
- uses: actions/checkout@v4
98+
999
- uses: actions/setup-node@v4
10100
with:
11101
node-version-file: '.nvmrc'
12-
cache: 'npm'
13-
- run: npm ci
14-
- run: npm run build:ci
102+
103+
- name: Restore node_modules cache
104+
uses: actions/cache/restore@v4
105+
with:
106+
path: node_modules
107+
key: ${{ needs.setup.outputs.cache-key }}
108+
109+
- name: Format check
110+
run: npm run format:check
111+
112+
# TypeScript job: Run type checking (parallel with other checks)
113+
typecheck:
114+
needs: setup
115+
runs-on:
116+
group: gusto-ubuntu-default
117+
steps:
118+
- uses: actions/checkout@v4
119+
120+
- uses: actions/setup-node@v4
121+
with:
122+
node-version-file: '.nvmrc'
123+
124+
- name: Restore node_modules cache
125+
uses: actions/cache/restore@v4
126+
with:
127+
path: node_modules
128+
key: ${{ needs.setup.outputs.cache-key }}
129+
130+
- name: TypeScript check
131+
run: npm run tsc
132+
133+
# Test job: Run tests with coverage (parallel with other checks)
134+
test:
135+
needs: setup
136+
runs-on:
137+
group: gusto-ubuntu-default
138+
steps:
139+
- uses: actions/checkout@v4
140+
141+
- uses: actions/setup-node@v4
142+
with:
143+
node-version-file: '.nvmrc'
144+
145+
- name: Restore node_modules cache
146+
uses: actions/cache/restore@v4
147+
with:
148+
path: node_modules
149+
key: ${{ needs.setup.outputs.cache-key }}
150+
151+
- name: Test with coverage
152+
run: npm run test:ci

.github/workflows/publish-rc.yaml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,46 @@ jobs:
6565
with:
6666
node-version-file: '.nvmrc'
6767
registry-url: 'https://registry.npmjs.org'
68-
- run: npm ci
69-
- run: npm run build
68+
69+
- name: Restore node_modules cache
70+
id: cache-node-modules
71+
uses: actions/cache/restore@v4
72+
with:
73+
path: node_modules
74+
key: node-modules-${{ hashFiles('package-lock.json') }}
75+
76+
- name: Install dependencies
77+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
78+
run: npm ci
79+
80+
- name: Save node_modules cache
81+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
82+
uses: actions/cache/save@v4
83+
with:
84+
path: node_modules
85+
key: node-modules-${{ hashFiles('package-lock.json') }}
86+
87+
- name: Restore build cache
88+
id: cache-build
89+
uses: actions/cache/restore@v4
90+
with:
91+
path: dist
92+
key: build-${{ github.sha }}
93+
94+
- name: Generate i18n translations
95+
if: steps.cache-build.outputs.cache-hit != 'true'
96+
run: npm run i18n:generate
97+
98+
- name: Build
99+
if: steps.cache-build.outputs.cache-hit != 'true'
100+
run: npx vite build
101+
102+
- name: Save build cache
103+
if: steps.cache-build.outputs.cache-hit != 'true'
104+
uses: actions/cache/save@v4
105+
with:
106+
path: dist
107+
key: build-${{ github.sha }}
70108

71109
- name: Show release info
72110
run: |

.github/workflows/publish.yaml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,53 @@ jobs:
99
id-token: write
1010
steps:
1111
- uses: actions/checkout@v4
12+
1213
- uses: actions/setup-node@v4
1314
with:
1415
node-version-file: '.nvmrc'
1516
registry-url: 'https://registry.npmjs.org'
16-
- run: npm ci
17-
- run: npm run build
18-
- run: npm publish --access public
17+
18+
- name: Restore node_modules cache
19+
id: cache-node-modules
20+
uses: actions/cache/restore@v4
21+
with:
22+
path: node_modules
23+
key: node-modules-${{ hashFiles('package-lock.json') }}
24+
25+
- name: Install dependencies
26+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
27+
run: npm ci
28+
29+
- name: Save node_modules cache
30+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
31+
uses: actions/cache/save@v4
32+
with:
33+
path: node_modules
34+
key: node-modules-${{ hashFiles('package-lock.json') }}
35+
36+
- name: Restore build cache
37+
id: cache-build
38+
uses: actions/cache/restore@v4
39+
with:
40+
path: dist
41+
key: build-${{ github.sha }}
42+
43+
- name: Generate i18n translations
44+
if: steps.cache-build.outputs.cache-hit != 'true'
45+
run: npm run i18n:generate
46+
47+
- name: Build
48+
if: steps.cache-build.outputs.cache-hit != 'true'
49+
run: npx vite build
50+
51+
- name: Save build cache
52+
if: steps.cache-build.outputs.cache-hit != 'true'
53+
uses: actions/cache/save@v4
54+
with:
55+
path: dist
56+
key: build-${{ github.sha }}
57+
58+
- name: Publish to NPM
59+
run: npm publish --access public
1960
env:
2061
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)