diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 820128ad67d..48b3378e2ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,8 @@ jobs: uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 + # Pull requests diff against the merge's first parent; pushes diff against the previous dev head. + fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 @@ -71,7 +72,8 @@ jobs: uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 + # Pull requests diff against the merge's first parent; pushes diff against the previous dev head. + fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} - name: Setup Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -94,15 +96,6 @@ jobs: git config --global user.email "bot@opencode.ai" git config --global user.name "opencode" - - name: Cache Turbo - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: node_modules/.cache/turbo - key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-${{ github.sha }} - restore-keys: | - turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}- - turbo-${{ runner.os }}- - - name: Run unit tests timeout-minutes: 20 run: | @@ -135,32 +128,6 @@ jobs: TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && format('{0}^1', github.sha) || github.event.before }} TURBO_SCM_HEAD: ${{ github.sha }} - - name: Verify compiled service lifecycle - if: always() - timeout-minutes: 10 - working-directory: packages/cli - env: - NODE_OPTIONS: ${{ runner.os == 'Windows' && '--max-old-space-size=4096' || '' }} - run: | - bun run script/build.ts --single --skip-install - bun run script/service-smoke.ts - - - name: Setup Node build runtime - if: always() - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: "26.4.0" - - - name: Verify Node build - if: always() - timeout-minutes: 15 - working-directory: packages/cli - env: - NODE_OPTIONS: ${{ runner.os == 'Windows' && '--max-old-space-size=4096' || '' }} - run: | - bun run script/build-node.ts --single --skip-install --outdir=dist/node - bun run script/service-smoke.ts --node - - name: Check generated client if: runner.os == 'Linux' working-directory: packages/client @@ -171,6 +138,54 @@ jobs: working-directory: services/www run: bun run check:generated + build: + name: build (${{ matrix.settings.name }}) + strategy: + fail-fast: false + matrix: + settings: + - name: linux + host: blacksmith-4vcpu-ubuntu-2404 + - name: windows + host: blacksmith-4vcpu-windows-2025 + runs-on: ${{ matrix.settings.host }} + defaults: + run: + shell: bash + steps: + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Bun + uses: ./.github/actions/setup-bun + + - name: Verify compiled service lifecycle + timeout-minutes: 10 + working-directory: packages/cli + env: + NODE_OPTIONS: ${{ runner.os == 'Windows' && '--max-old-space-size=4096' || '' }} + run: | + bun run script/build.ts --single --skip-install + bun run script/service-smoke.ts + + - name: Setup Node build runtime + if: ${{ !cancelled() }} + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: "26.4.0" + + - name: Verify Node build + if: ${{ !cancelled() }} + timeout-minutes: 15 + working-directory: packages/cli + env: + NODE_OPTIONS: ${{ runner.os == 'Windows' && '--max-old-space-size=4096' || '' }} + run: | + bun run script/build-node.ts --single --skip-install --outdir=dist/node + bun run script/service-smoke.ts --node + e2e: name: e2e (${{ matrix.settings.name }}) needs: affected