diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db5b51cbe..1f4b3fba4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,13 @@ concurrency: jobs: unit-test: - runs-on: ubuntu-latest + name: ${{ matrix.runner == 'ubuntu-latest' && 'unit-test' || format('unit-test ({0})', matrix.runner) }} + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["ubuntu-latest","blacksmith-4vcpu-ubuntu-2404"]' || '["ubuntu-latest"]') }} + runs-on: ${{ matrix.runner }} + continue-on-error: ${{ matrix.runner != 'ubuntu-latest' }} permissions: contents: read steps: @@ -25,7 +31,19 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - cache: "pnpm" + + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ matrix.runner }}- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -37,7 +55,13 @@ jobs: run: pnpm test integration-test: - runs-on: macos-latest + name: ${{ matrix.runner == 'macos-latest' && 'integration-test' || format('integration-test ({0})', matrix.runner) }} + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["macos-latest","blacksmith-6vcpu-macos-latest"]' || '["macos-latest"]') }} + runs-on: ${{ matrix.runner }} + continue-on-error: ${{ matrix.runner != 'macos-latest' }} permissions: contents: read steps: @@ -53,24 +77,36 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - cache: "pnpm" + + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ matrix.runner }}- - name: Cache Playwright browsers uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 id: playwright-cache with: path: ~/Library/Caches/ms-playwright - key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + key: playwright-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} restore-keys: | - playwright-${{ runner.os }}- + playwright-${{ matrix.runner }}- - name: Cache Electron binary uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: ~/Library/Caches/electron - key: electron-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + key: electron-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} restore-keys: | - electron-${{ runner.os }}- + electron-${{ matrix.runner }}- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -103,7 +139,7 @@ jobs: - name: Upload Playwright report uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 - if: failure() + if: failure() && matrix.runner == 'macos-latest' with: name: playwright-report path: apps/code/playwright-report/ diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 0701c6f39..dbd26f4a9 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -9,7 +9,13 @@ concurrency: jobs: typecheck: - runs-on: ubuntu-latest + name: ${{ matrix.runner == 'ubuntu-latest' && 'typecheck' || format('typecheck ({0})', matrix.runner) }} + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["ubuntu-latest","blacksmith-4vcpu-ubuntu-2404"]' || '["ubuntu-latest"]') }} + runs-on: ${{ matrix.runner }} + continue-on-error: ${{ matrix.runner != 'ubuntu-latest' }} permissions: contents: read steps: @@ -25,7 +31,19 @@ jobs: uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - cache: "pnpm" + + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ matrix.runner }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ matrix.runner }}- - name: Install dependencies run: pnpm install --frozen-lockfile