|
| 1 | +name: CI Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - ci-improv |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - '**' |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ci-tests-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + packages-tests: |
| 18 | + name: Packages Tests |
| 19 | + runs-on: ubuntu-latest |
| 20 | + timeout-minutes: 20 |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Setup Node |
| 26 | + uses: actions/setup-node@v4 |
| 27 | + with: |
| 28 | + node-version: '20' |
| 29 | + cache: 'pnpm' |
| 30 | + |
| 31 | + - name: Setup pnpm |
| 32 | + uses: pnpm/action-setup@v4 |
| 33 | + with: |
| 34 | + version: 10.14.0 |
| 35 | + |
| 36 | + - name: Get pnpm store directory |
| 37 | + id: pnpm-cache |
| 38 | + run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 39 | + |
| 40 | + - name: Cache pnpm store |
| 41 | + uses: actions/cache@v4 |
| 42 | + with: |
| 43 | + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} |
| 44 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 45 | + restore-keys: | |
| 46 | + ${{ runner.os }}-pnpm-store- |
| 47 | +
|
| 48 | + - name: Install dependencies |
| 49 | + run: pnpm install --frozen-lockfile |
| 50 | + |
| 51 | + - name: Build (to ensure types compile) |
| 52 | + run: pnpm build |
| 53 | + |
| 54 | + - name: Run workspace tests |
| 55 | + run: pnpm -r --if-present test |
| 56 | + |
| 57 | + e2e-web: |
| 58 | + name: E2E Web |
| 59 | + runs-on: ubuntu-latest |
| 60 | + timeout-minutes: 30 |
| 61 | + env: |
| 62 | + NEXT_TELEMETRY_DISABLED: '1' |
| 63 | + steps: |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
| 66 | + |
| 67 | + - name: Setup Node |
| 68 | + uses: actions/setup-node@v4 |
| 69 | + with: |
| 70 | + node-version: '20' |
| 71 | + cache: 'pnpm' |
| 72 | + |
| 73 | + - name: Setup pnpm |
| 74 | + uses: pnpm/action-setup@v4 |
| 75 | + with: |
| 76 | + version: 10.14.0 |
| 77 | + |
| 78 | + - name: Get pnpm store directory |
| 79 | + id: pnpm-cache |
| 80 | + run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 81 | + |
| 82 | + - name: Cache pnpm store |
| 83 | + uses: actions/cache@v4 |
| 84 | + with: |
| 85 | + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} |
| 86 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 87 | + restore-keys: | |
| 88 | + ${{ runner.os }}-pnpm-store- |
| 89 | +
|
| 90 | + - name: Install dependencies |
| 91 | + run: pnpm install --frozen-lockfile |
| 92 | + |
| 93 | + - name: Install Playwright browsers |
| 94 | + working-directory: apps/web |
| 95 | + run: pnpm exec playwright install --with-deps |
| 96 | + |
| 97 | + - name: Run Playwright tests |
| 98 | + working-directory: apps/web |
| 99 | + env: |
| 100 | + CI: 'true' |
| 101 | + run: pnpm run e2e:ci |
| 102 | + |
| 103 | + - name: Upload Playwright report |
| 104 | + if: always() |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: playwright-report |
| 108 | + path: apps/web/playwright-report |
| 109 | + |
| 110 | + agent-tests: |
| 111 | + name: Agent Tests (Python) |
| 112 | + runs-on: ubuntu-latest |
| 113 | + timeout-minutes: 20 |
| 114 | + steps: |
| 115 | + - name: Checkout |
| 116 | + uses: actions/checkout@v4 |
| 117 | + |
| 118 | + - name: Setup Python |
| 119 | + uses: actions/setup-python@v5 |
| 120 | + with: |
| 121 | + python-version: '3.11' |
| 122 | + |
| 123 | + - name: Cache pip |
| 124 | + uses: actions/cache@v4 |
| 125 | + with: |
| 126 | + path: ~/.cache/pip |
| 127 | + key: ${{ runner.os }}-pip-${{ hashFiles('packages/agent/requirements.txt') }} |
| 128 | + restore-keys: | |
| 129 | + ${{ runner.os }}-pip- |
| 130 | +
|
| 131 | + - name: Install Python dependencies |
| 132 | + working-directory: packages/agent |
| 133 | + run: | |
| 134 | + python -m pip install --upgrade pip |
| 135 | + pip install -r requirements.txt |
| 136 | +
|
| 137 | + - name: Run pytest |
| 138 | + working-directory: packages/agent |
| 139 | + run: | |
| 140 | + pytest -q |
| 141 | +
|
| 142 | +
|
0 commit comments