Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 101 additions & 11 deletions .github/workflows/j5-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ concurrency:
group: j5-ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# One serial job used to run format, lint, typecheck, and every package's tests
# and had crept up to its 20 minute timeout with all tests green. The work is
# now split across parallel jobs, mirroring upstream ci.yml. The `quality`
# gate at the bottom keeps the check name the default-branch ruleset requires.
jobs:
quality:
name: Format, lint, typecheck, and unit tests
checks:
name: Format, lint, and typecheck
runs-on: ubuntu-24.04
timeout-minutes: 20
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -39,11 +43,6 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install browser secret helper build libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libsecret-1-dev pkg-config

- name: Check formatting
run: pnpm exec vp fmt --check

Expand All @@ -53,9 +52,6 @@ jobs:
- name: Typecheck
run: pnpm exec vp run -r --concurrency-limit 2 --log grouped typecheck

- name: Unit tests
run: pnpm exec vp run -r --log grouped test

# actions/checkout runs its credential cleanup after all workflow steps.
# That cleanup recursively visits this vendored gitlink, but its manifest
# belongs to the vendored tree rather than this repository. Remove the
Expand All @@ -64,3 +60,97 @@ jobs:
- name: Exclude vendored gitlink from checkout cleanup
if: always()
run: git update-index --force-remove -- .repos/alchemy-effect/.vendor/alchemy

# Every package except `t3` (apps/server), which gets its own sharded job.
test:
name: Test
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 11.10.0
run_install: false

- name: Install Node from .nvmrc
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

# apps/desktop's Linux secret storage tests build the native helper.
- name: Install browser secret helper build libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libsecret-1-dev pkg-config

- name: Test
run: pnpm exec vp run --log grouped --filter '!t3' --filter '!@t3tools/monorepo' test

- name: Exclude vendored gitlink from checkout cleanup
if: always()
run: git update-index --force-remove -- .repos/alchemy-effect/.vendor/alchemy

# apps/server sets `fileParallelism: false`, so its files run strictly one at
# a time and the package alone took over eleven minutes. Sharding spreads the
# files over separate runners, so no two server test files share a machine
# and the isolation that flag buys is preserved exactly.
test_server:
name: Test Server ${{ matrix.shard }}
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3]
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 11.10.0
run_install: false

- name: Install Node from .nvmrc
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm exec vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }}

- name: Exclude vendored gitlink from checkout cleanup
if: always()
run: git update-index --force-remove -- .repos/alchemy-effect/.vendor/alchemy

# The default-branch ruleset requires a check with this exact name. It passes
# only when every job above passed, so renaming or adding jobs never silently
# weakens the merge gate.
quality:
name: Format, lint, typecheck, and unit tests
if: always()
needs: [checks, test, test_server]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Require every job to pass
env:
RESULTS: ${{ toJSON(needs.*.result) }}
run: |
echo "$RESULTS"
case "$RESULTS" in
*failure*|*cancelled*|*skipped*) exit 1 ;;
esac
Loading