|
| 1 | +name: Runtime Compatibility Tests |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + runtimes: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + os: [ubuntu-latest] |
| 11 | + node: [18, 20] |
| 12 | + include: |
| 13 | + - runner: deno |
| 14 | + - runner: bun |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + # Setup Node.js for matrix versions |
| 20 | + - if: matrix.runner != 'deno' && matrix.runner != 'bun' |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: ${{ matrix.node }} |
| 24 | + |
| 25 | + # Setup Deno |
| 26 | + - if: matrix.runner == 'deno' |
| 27 | + uses: denoland/setup-deno@v2 |
| 28 | + with: |
| 29 | + deno-version: v1.x |
| 30 | + |
| 31 | + # Setup Bun |
| 32 | + - if: matrix.runner == 'bun' |
| 33 | + uses: oven-sh/setup-bun@v2 |
| 34 | + |
| 35 | + - name: Install dependencies |
| 36 | + run: npm install |
| 37 | + |
| 38 | + - name: Build |
| 39 | + run: npm run build |
| 40 | + |
| 41 | + # Run runtime-specific tests |
| 42 | + - name: Test Node.js |
| 43 | + if: matrix.runner != 'deno' && matrix.runner != 'bun' |
| 44 | + run: npm run test:node |
| 45 | + |
| 46 | + - name: Test Deno |
| 47 | + if: matrix.runner == 'deno' |
| 48 | + run: npm run test:deno |
| 49 | + |
| 50 | + - name: Test Bun |
| 51 | + if: matrix.runner == 'bun' |
| 52 | + run: npm run test:bun |
| 53 | + |
| 54 | + - name: Test Edge/Workers |
| 55 | + if: matrix.runner != 'deno' && matrix.runner != 'bun' |
| 56 | + run: npm run test:edge |
| 57 | + |
| 58 | + # Fail-fast smoke tests (similar to OpenAI's ecosystem-tests) |
| 59 | + smoke-tests: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: actions/setup-node@v4 |
| 64 | + with: |
| 65 | + node-version: '20' |
| 66 | + - uses: denoland/setup-deno@v2 |
| 67 | + with: |
| 68 | + deno-version: v1.x |
| 69 | + - uses: oven-sh/setup-bun@v2 |
| 70 | + |
| 71 | + - name: Install and build |
| 72 | + run: | |
| 73 | + npm install |
| 74 | + npm run build |
| 75 | +
|
| 76 | + - name: Quick compatibility check |
| 77 | + run: | |
| 78 | + # Node.js |
| 79 | + node -e "console.log('✅ Node CJS:', require('./lib/cjs/index.cjs').WorkOS.name)" |
| 80 | + node -e "import('./lib/esm/index.js').then(m => console.log('✅ Node ESM:', m.WorkOS.name))" |
| 81 | +
|
| 82 | + # Deno |
| 83 | + deno run --allow-read -e "import('./lib/esm/index.js').then(m => console.log('✅ Deno:', m.WorkOS.name))" |
| 84 | +
|
| 85 | + # Bun |
| 86 | + bun -e "console.log('✅ Bun:', require('./lib/cjs/index.cjs').WorkOS.name)" |
| 87 | +
|
0 commit comments