Skip to content

Commit

Permalink
Run CI tests in node (incl edge-runtime), not bun
Browse files Browse the repository at this point in the history
  • Loading branch information
jawj committed Dec 18, 2024
1 parent 6af67df commit f8ba0b0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,46 @@ on:
- main

jobs:
test:
test-node-20:
runs-on: ubuntu-latest
steps:
# setup
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install package dependencies
run: bun install
run: npm install

# goal
- name: Run tests
- name: Run tests in Node 20 (no native WebSocket), node environment
env:
VITE_NEON_DB_URL: ${{ secrets.VITE_NEON_DB_URL }}
VITE_WSPROXY: ${{ vars.VITE_WSPROXY }}
run: bun run test
run: npm run testNode

test-node-lts:
runs-on: ubuntu-latest
steps:
# setup
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts

- name: Install package dependencies
run: npm install

# goal
- name: Run tests in Node LTS, node environment
env:
VITE_NEON_DB_URL: ${{ secrets.VITE_NEON_DB_URL }}
VITE_WSPROXY: ${{ vars.VITE_WSPROXY }}
run: npm run testNode

- name: Run tests in Node LTS, edge-runtime environment
env:
VITE_NEON_DB_URL: ${{ secrets.VITE_NEON_DB_URL }}
VITE_WSPROXY: ${{ vars.VITE_WSPROXY }}
run: npm run testEdge
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
"cfDeploy": "npm run build && wrangler deploy",
"format": "prettier -c .",
"format:fix": "prettier -w .",
"test": "./export.sh && vitest run --no-file-parallelism"
"testNode": "./export.sh && vitest run --environment=node --no-file-parallelism",
"testEdge": "./export.sh && vitest run --environment=edge-runtime --no-file-parallelism"
},
"devDependencies": {
"@edge-runtime/vm": "^5.0.0",
"@microsoft/api-extractor": "^7.48.1",
"@types/events": "^3.0.0",
"@types/pg": "^8.6.5",
Expand Down

0 comments on commit f8ba0b0

Please sign in to comment.