|
| 1 | +name: "🔌 SDK Compatibility Tests" |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_call: |
| 8 | + |
| 9 | +jobs: |
| 10 | + node-compat: |
| 11 | + name: "Node.js ${{ matrix.node }} (${{ matrix.os }})" |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest] |
| 17 | + node: ["20.20", "22.12"] |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: ⬇️ Checkout repo |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - name: ⎔ Setup pnpm |
| 26 | + uses: pnpm/action-setup@v4 |
| 27 | + with: |
| 28 | + version: 10.23.0 |
| 29 | + |
| 30 | + - name: ⎔ Setup node |
| 31 | + uses: buildjet/setup-node@v4 |
| 32 | + with: |
| 33 | + node-version: ${{ matrix.node }} |
| 34 | + cache: "pnpm" |
| 35 | + |
| 36 | + - name: 📥 Download deps |
| 37 | + run: pnpm install --frozen-lockfile |
| 38 | + |
| 39 | + - name: 📀 Generate Prisma Client |
| 40 | + run: pnpm run generate |
| 41 | + |
| 42 | + - name: 🔨 Build SDK dependencies |
| 43 | + shell: bash |
| 44 | + run: pnpm run build --filter '@trigger.dev/sdk^...' |
| 45 | + |
| 46 | + - name: 🔨 Build SDK |
| 47 | + shell: bash |
| 48 | + run: pnpm run build --filter '@trigger.dev/sdk' |
| 49 | + |
| 50 | + - name: 🧪 Run SDK Compatibility Tests |
| 51 | + shell: bash |
| 52 | + run: pnpm --filter @internal/sdk-compat-tests test |
| 53 | + |
| 54 | + bun-compat: |
| 55 | + name: "Bun Runtime" |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - name: ⬇️ Checkout repo |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + fetch-depth: 0 |
| 62 | + |
| 63 | + - name: ⎔ Setup pnpm |
| 64 | + uses: pnpm/action-setup@v4 |
| 65 | + with: |
| 66 | + version: 10.23.0 |
| 67 | + |
| 68 | + - name: ⎔ Setup node |
| 69 | + uses: buildjet/setup-node@v4 |
| 70 | + with: |
| 71 | + node-version: 20.20.0 |
| 72 | + cache: "pnpm" |
| 73 | + |
| 74 | + - name: 🥟 Setup Bun |
| 75 | + uses: oven-sh/setup-bun@v2 |
| 76 | + with: |
| 77 | + bun-version: latest |
| 78 | + |
| 79 | + - name: 📥 Download deps |
| 80 | + run: pnpm install --frozen-lockfile |
| 81 | + |
| 82 | + - name: 📀 Generate Prisma Client |
| 83 | + run: pnpm run generate |
| 84 | + |
| 85 | + - name: 🔨 Build SDK dependencies |
| 86 | + run: pnpm run build --filter @trigger.dev/sdk^... |
| 87 | + |
| 88 | + - name: 🔨 Build SDK |
| 89 | + run: pnpm run build --filter @trigger.dev/sdk |
| 90 | + |
| 91 | + - name: 🧪 Run Bun Compatibility Test |
| 92 | + working-directory: internal-packages/sdk-compat-tests/src/fixtures/bun |
| 93 | + run: bun run test.ts |
| 94 | + |
| 95 | + deno-compat: |
| 96 | + name: "Deno Runtime" |
| 97 | + runs-on: ubuntu-latest |
| 98 | + steps: |
| 99 | + - name: ⬇️ Checkout repo |
| 100 | + uses: actions/checkout@v4 |
| 101 | + with: |
| 102 | + fetch-depth: 0 |
| 103 | + |
| 104 | + - name: ⎔ Setup pnpm |
| 105 | + uses: pnpm/action-setup@v4 |
| 106 | + with: |
| 107 | + version: 10.23.0 |
| 108 | + |
| 109 | + - name: ⎔ Setup node |
| 110 | + uses: buildjet/setup-node@v4 |
| 111 | + with: |
| 112 | + node-version: 20.20.0 |
| 113 | + cache: "pnpm" |
| 114 | + |
| 115 | + - name: 🦕 Setup Deno |
| 116 | + uses: denoland/setup-deno@v2 |
| 117 | + with: |
| 118 | + deno-version: v2.x |
| 119 | + |
| 120 | + - name: 📥 Download deps |
| 121 | + run: pnpm install --frozen-lockfile |
| 122 | + |
| 123 | + - name: 📀 Generate Prisma Client |
| 124 | + run: pnpm run generate |
| 125 | + |
| 126 | + - name: 🔨 Build SDK dependencies |
| 127 | + run: pnpm run build --filter @trigger.dev/sdk^... |
| 128 | + |
| 129 | + - name: 🔨 Build SDK |
| 130 | + run: pnpm run build --filter @trigger.dev/sdk |
| 131 | + |
| 132 | + - name: 🔗 Link node_modules for Deno fixture |
| 133 | + working-directory: internal-packages/sdk-compat-tests/src/fixtures/deno |
| 134 | + run: ln -s ../../../../../node_modules node_modules |
| 135 | + |
| 136 | + - name: 🧪 Run Deno Compatibility Test |
| 137 | + working-directory: internal-packages/sdk-compat-tests/src/fixtures/deno |
| 138 | + run: deno run --allow-read --allow-env --allow-sys test.ts |
| 139 | + |
| 140 | + cloudflare-compat: |
| 141 | + name: "Cloudflare Workers" |
| 142 | + runs-on: ubuntu-latest |
| 143 | + steps: |
| 144 | + - name: ⬇️ Checkout repo |
| 145 | + uses: actions/checkout@v4 |
| 146 | + with: |
| 147 | + fetch-depth: 0 |
| 148 | + |
| 149 | + - name: ⎔ Setup pnpm |
| 150 | + uses: pnpm/action-setup@v4 |
| 151 | + with: |
| 152 | + version: 10.23.0 |
| 153 | + |
| 154 | + - name: ⎔ Setup node |
| 155 | + uses: buildjet/setup-node@v4 |
| 156 | + with: |
| 157 | + node-version: 20.20.0 |
| 158 | + cache: "pnpm" |
| 159 | + |
| 160 | + - name: 📥 Download deps |
| 161 | + run: pnpm install --frozen-lockfile |
| 162 | + |
| 163 | + - name: 📀 Generate Prisma Client |
| 164 | + run: pnpm run generate |
| 165 | + |
| 166 | + - name: 🔨 Build SDK dependencies |
| 167 | + run: pnpm run build --filter @trigger.dev/sdk^... |
| 168 | + |
| 169 | + - name: 🔨 Build SDK |
| 170 | + run: pnpm run build --filter @trigger.dev/sdk |
| 171 | + |
| 172 | + - name: 📥 Install Cloudflare fixture deps |
| 173 | + working-directory: internal-packages/sdk-compat-tests/src/fixtures/cloudflare-worker |
| 174 | + run: pnpm install |
| 175 | + |
| 176 | + - name: 🧪 Run Cloudflare Workers Compatibility Test (dry-run) |
| 177 | + working-directory: internal-packages/sdk-compat-tests/src/fixtures/cloudflare-worker |
| 178 | + run: npx wrangler deploy --dry-run --outdir dist |
0 commit comments