Turborepo
Turborepo Example Workflow
A complete GitHub Actions workflow using DxCore with Turborepo.
Full Example
This workflow demonstrates a complete DxCore + Turborepo integration running build and test across 4 parallel agents.
name: CI with DxCore
on: [push, pull_request]
env:
DXCORE_URL: ${{ secrets.DXCORE_URL }}
DXCORE_TOKEN: ${{ secrets.DXCORE_TOKEN }}
jobs:
session:
runs-on: ubuntu-latest
outputs:
session_id: ${{ steps.create.outputs.session_id }}
steps:
- name: Create DxCore session
id: create
run: |
SESSION=$(dxcore ci create-session -c $DXCORE_URL -t $DXCORE_TOKEN)
echo "session_id=$SESSION" >> "$GITHUB_OUTPUT"
- name: Wait for coordinator
run: dxcore ci wait -c $DXCORE_URL --timeout 300
dispatch:
needs: session
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- name: Dispatch graph
run: |
turbo run build test --dry=json | dxcore dispatch \
-c $DXCORE_URL -s ${{ needs.session.outputs.session_id }} \
-t $DXCORE_TOKEN -b turbo
agent:
needs: session
runs-on: ubuntu-latest
strategy:
matrix:
shard: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- name: Run DxCore agent
run: |
dxcore agent \
-c $DXCORE_URL \
-a agent-${{ matrix.shard }} \
-s ${{ needs.session.outputs.session_id }} \
-t $DXCORE_TOKEN \
-b turbo
finish:
needs: [session, dispatch, agent]
if: always()
runs-on: ubuntu-latest
steps:
- name: Finish session
run: |
dxcore ci finish \
-c $DXCORE_URL \
-s ${{ needs.session.outputs.session_id }} \
-t $DXCORE_TOKEN
What Happens
- session — Creates a coordinator session and waits for readiness
- dispatch — Pipes the Turborepo dry-run graph to the coordinator
- agent (x4) — Each agent connects, receives tasks, and executes them
- finish — Marks the session complete regardless of outcome
Note
The dispatch and agent jobs run concurrently. Agents will wait for tasks once connected — they do not need the graph to be submitted first.
Scaling Agents
Change the matrix.shard array to add or remove agents. More agents means more parallelism, but only up to the number of independent tasks in your graph.