ci: test node and bun runtimes
This commit is contained in:
42
.github/workflows/ci.yml
vendored
42
.github/workflows/ci.yml
vendored
@@ -7,20 +7,39 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
runtime: [node, bun]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
if: matrix.runtime == 'node'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Node version
|
- name: Setup Bun
|
||||||
|
if: matrix.runtime == 'bun'
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: "1.3.x"
|
||||||
|
|
||||||
|
- name: Setup Node.js (tooling for bun)
|
||||||
|
if: matrix.runtime == 'bun'
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Runtime versions
|
||||||
run: |
|
run: |
|
||||||
node -v
|
node -v
|
||||||
npm -v
|
npm -v
|
||||||
|
if [ "${{ matrix.runtime }}" = "bun" ]; then bun -v; fi
|
||||||
|
|
||||||
- name: Capture node path
|
- name: Capture node path
|
||||||
run: echo "NODE_BIN=$(dirname \"$(node -p \"process.execPath\")\")" >> "$GITHUB_ENV"
|
run: echo "NODE_BIN=$(dirname \"$(node -p \"process.execPath\")\")" >> "$GITHUB_ENV"
|
||||||
@@ -41,15 +60,30 @@ jobs:
|
|||||||
pnpm -v
|
pnpm -v
|
||||||
pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint (node)
|
||||||
|
if: matrix.runtime == 'node'
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
|
|
||||||
- name: Test
|
- name: Test (node)
|
||||||
|
if: matrix.runtime == 'node'
|
||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
|
||||||
- name: Build
|
- name: Build (node)
|
||||||
|
if: matrix.runtime == 'node'
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
|
- name: Lint (bun)
|
||||||
|
if: matrix.runtime == 'bun'
|
||||||
|
run: bunx biome check src
|
||||||
|
|
||||||
|
- name: Test (bun)
|
||||||
|
if: matrix.runtime == 'bun'
|
||||||
|
run: bunx vitest run
|
||||||
|
|
||||||
|
- name: Build (bun)
|
||||||
|
if: matrix.runtime == 'bun'
|
||||||
|
run: bunx tsc -p tsconfig.json
|
||||||
|
|
||||||
macos-app:
|
macos-app:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Reference in New Issue
Block a user