diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fd38866..efd2de3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ concurrency: jobs: quality: - name: Format, Lint, Typecheck, Test, Browser Test, Build + name: Format, Lint, Typecheck, Test, Build runs-on: ubuntu-latest # 20 minutes starves dependency-bump branches: a lockfile change cold-starts # every cache and slow runners then hit the cap mid-pipeline. @@ -58,7 +58,38 @@ jobs: run: vp exec vp run -r --concurrency-limit 2 typecheck - name: Test - run: vp exec vp run test + # --parallel drops package ordering: server depends on web, so without it + # the server suite (~2.5 min) waits for the web suite (~3 min) to finish. + run: vp exec vp run --parallel --concurrency-limit 4 test + + - name: Build desktop pipeline + run: vp exec vp run build:desktop + + - name: Verify preload bundle output + run: | + test -f apps/desktop/dist-electron/preload.cjs + grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs + + browser: + # Runs beside `quality` rather than after it: the browser suite is the + # second-longest step and shares nothing with the unit suite. + name: Browser Test + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Setup Vite+ + uses: voidzero-dev/setup-vp@313600b80b104eadebb9111787d37a2e83e014ca # v1.17.0 + with: + node-version-file: package.json + cache: true + version: "0.2.4" + run-install: false + + - name: Install dependencies + run: vp install --frozen-lockfile # Hosted runners point apt at azure.archive.ubuntu.com, which # intermittently stalls for 20+ minutes and starves the job timeout. @@ -84,14 +115,6 @@ jobs: path: apps/web/src/**/__screenshots__/** if-no-files-found: ignore - - name: Build desktop pipeline - run: vp exec vp run build:desktop - - - name: Verify preload bundle output - run: | - test -f apps/desktop/dist-electron/preload.cjs - grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs - release_smoke: name: Release Smoke runs-on: ubuntu-latest @@ -118,6 +141,7 @@ jobs: name: Deploy app.threadlines.dev needs: - quality + - browser - release_smoke if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && inputs.deploy == true uses: ./.github/workflows/deploy-web.yml diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 6754063b..e2dea04d 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -2,8 +2,10 @@ name: Nightly Release Cron on: schedule: - # 06:00 ET daily; skips when main has not moved since the newest release. - - cron: "0 10 * * *" + # 06:07 ET daily; skips when main has not moved since the newest release. + # Minute 7, not 0: GitHub queues top-of-the-hour crons the longest (ours + # started 14-22 minutes late). + - cron: "7 10 * * *" workflow_dispatch: permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac13963d..51bf3ce6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,9 @@ permissions: concurrency: group: desktop-release-${{ github.ref }} - cancel-in-progress: true + # Never cancel a publisher mid-run: a second nightly on main queues instead + # of leaving a half-uploaded draft release behind. + cancel-in-progress: false jobs: preflight: @@ -577,7 +579,6 @@ jobs: timeout-minutes: 50 strategy: fail-fast: false - max-parallel: 1 matrix: ${{ fromJSON(needs.preflight.outputs.macos_matrix) }} steps: - name: Checkout diff --git a/package.json b/package.json index e900c6c2..f438b88b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "typecheck": "vp run -r --concurrency-limit 2 --cache typecheck", "tc": "vp run -r --concurrency-limit 2 --cache typecheck", "lint": "vp lint --report-unused-disable-directives", - "test": "vp run -r --cache test", + "test": "vp run -r --parallel --concurrency-limit 4 --cache test", "test:desktop-smoke": "vp run --filter @threadlines/desktop smoke-test", "fmt": "vp fmt", "fmt:check": "vp fmt --check",