|
53 | 53 | run: echo "BASE=$NX_BASE HEAD=$NX_HEAD" |
54 | 54 |
|
55 | 55 | - name: Pre-start Supabase for affected packages |
56 | | - run: ./scripts/ci-prestart-supabase.sh core client |
| 56 | + run: ./scripts/ci-prestart-supabase.sh core client cli |
57 | 57 |
|
58 | 58 | - name: Quality gate (lint + typecheck + test) |
59 | 59 | run: pnpm nx affected -t lint typecheck test --parallel --configuration=production --base="$NX_BASE" --head="$NX_HEAD" |
@@ -117,9 +117,62 @@ jobs: |
117 | 117 | if: steps.check-affected.outputs.affected == 'true' |
118 | 118 | run: pnpm nx affected -t test:e2e --parallel --base="$NX_BASE" --head="$NX_HEAD" |
119 | 119 |
|
| 120 | + # ─────────────────────────────────────── 2b. CLI E2E ────────────────────────────────────── |
| 121 | + cli-e2e: |
| 122 | + runs-on: ubuntu-latest |
| 123 | + env: |
| 124 | + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} |
| 125 | + steps: |
| 126 | + - uses: actions/checkout@v4 |
| 127 | + with: |
| 128 | + fetch-depth: 0 |
| 129 | + |
| 130 | + - uses: ./.github/actions/setup |
| 131 | + |
| 132 | + - name: Setup Deno |
| 133 | + uses: denoland/setup-deno@v2 |
| 134 | + with: |
| 135 | + deno-version: '2.1.4' |
| 136 | + |
| 137 | + - name: Install sqruff |
| 138 | + uses: ./.github/actions/setup-sqruff |
| 139 | + with: |
| 140 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 141 | + |
| 142 | + - name: Setup Atlas |
| 143 | + uses: ariga/setup-atlas@master |
| 144 | + with: |
| 145 | + cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }} |
| 146 | + |
| 147 | + - name: Set Nx base for affected commands |
| 148 | + run: | |
| 149 | + echo "NX_BASE=origin/main" >> $GITHUB_ENV |
| 150 | + echo "NX_HEAD=HEAD" >> $GITHUB_ENV |
| 151 | +
|
| 152 | + - name: Verify NX_BASE and NX_HEAD are set |
| 153 | + run: echo "BASE=$NX_BASE HEAD=$NX_HEAD" |
| 154 | + |
| 155 | + - name: Pre-start Supabase for CLI |
| 156 | + run: ./scripts/ci-prestart-supabase.sh cli |
| 157 | + |
| 158 | + - name: Check if CLI e2e tests are affected |
| 159 | + id: check-affected |
| 160 | + run: | |
| 161 | + if pnpm nx show projects --affected -t test:e2e --base="$NX_BASE" --head="$NX_HEAD" | grep -q "^cli$"; then |
| 162 | + echo "affected=true" >> $GITHUB_OUTPUT |
| 163 | + echo "CLI e2e tests are affected by changes" |
| 164 | + else |
| 165 | + echo "affected=false" >> $GITHUB_OUTPUT |
| 166 | + echo "CLI e2e tests are not affected by changes - skipping" |
| 167 | + fi |
| 168 | +
|
| 169 | + - name: Run CLI e2e tests |
| 170 | + if: steps.check-affected.outputs.affected == 'true' |
| 171 | + run: pnpm nx test:e2e cli |
| 172 | + |
120 | 173 | # ────────────────────────────────── 3. DEPLOY WEBSITE ─────────────────────────── |
121 | 174 | deploy-website: |
122 | | - needs: [build-and-test, edge-worker-e2e] |
| 175 | + needs: [build-and-test, edge-worker-e2e, cli-e2e] |
123 | 176 | runs-on: ubuntu-latest |
124 | 177 | environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} |
125 | 178 | env: |
@@ -203,7 +256,7 @@ jobs: |
203 | 256 | # ────────────────────────────────── 4. DEPLOY DEMO ─────────────────────────── |
204 | 257 | deploy-demo: |
205 | 258 | if: false # temporarily disabled |
206 | | - needs: [build-and-test, edge-worker-e2e] |
| 259 | + needs: [build-and-test, edge-worker-e2e, cli-e2e] |
207 | 260 | runs-on: ubuntu-latest |
208 | 261 | environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} |
209 | 262 | env: |
|
0 commit comments