Skip to content

Commit a77b27e

Browse files
committed
add testing
1 parent 99466c2 commit a77b27e

File tree

9 files changed

+1307
-15
lines changed

9 files changed

+1307
-15
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ on:
99
- main
1010

1111
jobs:
12-
deploy:
12+
validate:
1313
runs-on: ubuntu-latest
14-
name: Deploy
14+
strategy:
15+
matrix:
16+
command: [typecheck, lint, test]
17+
name: ${{ matrix.command }}
1518
steps:
1619
- uses: actions/checkout@v4
1720

@@ -24,14 +27,27 @@ jobs:
2427
- name: Install Dependencies
2528
run: npm ci
2629

27-
- name: Typecheck
28-
run: npm run typecheck
30+
- name: Run ${{ matrix.command }}
31+
run: npm run ${{ matrix.command }}
32+
33+
deploy:
34+
needs: validate
35+
runs-on: ubuntu-latest
36+
name: Deploy
37+
if: github.ref == 'refs/heads/main'
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: '22'
45+
cache: 'npm'
2946

30-
- name: Lint
31-
run: npm run lint
47+
- name: Install Dependencies
48+
run: npm ci
3249

3350
- name: Deploy to Cloudflare Workers
34-
if: github.ref == 'refs/heads/main'
3551
env:
3652
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
3753
run: |

0 commit comments

Comments
 (0)