|
| 1 | +name: ci-compiler-cache-trial |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [codex/ci-next-cache-trial] |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | +jobs: |
| 8 | + cold: |
| 9 | + name: cold (${{ matrix.cache }}) |
| 10 | + runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-16vcpu-ubuntu-2404' || 'linux-x64-8-core' }} |
| 11 | + timeout-minutes: 25 |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + cache: ['off', 'on'] |
| 16 | + services: |
| 17 | + postgres: |
| 18 | + image: pgvector/pgvector:pg17 |
| 19 | + env: |
| 20 | + POSTGRES_USER: postgres |
| 21 | + POSTGRES_PASSWORD: postgres |
| 22 | + POSTGRES_DB: sim_test |
| 23 | + ports: ['5432:5432'] |
| 24 | + options: --health-cmd "pg_isready -U postgres -d sim_test" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 25 | + redis: |
| 26 | + image: redis:8.2-alpine |
| 27 | + ports: ['6379:6379'] |
| 28 | + options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 29 | + env: |
| 30 | + CI_PERSISTENT_CACHE_TRIAL: ${{ matrix.cache }} |
| 31 | + NEXT_PUBLIC_APP_URL: http://localhost:3000 |
| 32 | + BETTER_AUTH_URL: http://localhost:3000 |
| 33 | + BETTER_AUTH_SECRET: compiler-cache-trial-secret-at-least-32-characters |
| 34 | + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/sim_test |
| 35 | + REDIS_URL: redis://127.0.0.1:6379 |
| 36 | + STRIPE_SECRET_KEY: dummy_key_for_ci_only |
| 37 | + STRIPE_WEBHOOK_SECRET: dummy_secret_for_ci_only |
| 38 | + RESEND_API_KEY: dummy_key_for_ci_only |
| 39 | + AWS_REGION: us-west-2 |
| 40 | + ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' |
| 41 | + NEXT_BUILD_SKIP_TYPE_CHECK: 'true' |
| 42 | + NEXT_BUILD_SKIP_SOURCE_MAPS: 'true' |
| 43 | + NODE_OPTIONS: --no-warnings --max-old-space-size=8192 |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 46 | + - uses: ./.github/actions/setup |
| 47 | + with: |
| 48 | + provider: github |
| 49 | + - name: Mount isolated trial compiler state |
| 50 | + if: matrix.cache == 'on' |
| 51 | + uses: ./.github/actions/cache |
| 52 | + with: |
| 53 | + provider: ${{ vars.CI_PROVIDER }} |
| 54 | + key: ${{ github.repository }}-compiler-requalification-${{ github.run_id }} |
| 55 | + path: ./apps/sim/.next/cache |
| 56 | + save-suffix: -${{ github.job }} |
| 57 | + - name: Provision disposable application infrastructure |
| 58 | + working-directory: packages/db |
| 59 | + run: | |
| 60 | + bun -e 'import postgres from "postgres"; const sql = postgres(process.env.DATABASE_URL); for (const extension of ["vector", "btree_gin", "pg_trgm"]) await sql`CREATE EXTENSION IF NOT EXISTS ${sql(extension)}`; await sql.end()' |
| 61 | + bun run db:migrate |
| 62 | + - name: Compile and serve actual transitive metadata |
| 63 | + run: python3 .github/scripts/compiler-cache-trial.py build |
| 64 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 65 | + if: always() |
| 66 | + with: |
| 67 | + name: compiler-cache-${{ github.job }}-${{ matrix.cache }} |
| 68 | + path: | |
| 69 | + ${{ runner.temp }}/cache-build-proof.json |
| 70 | + ${{ runner.temp }}/compile-time.txt |
| 71 | + ${{ runner.temp }}/compile.log |
| 72 | + ${{ runner.temp }}/server.log |
| 73 | + warm: |
| 74 | + name: warm (${{ matrix.cache }}) |
| 75 | + needs: [cold] |
| 76 | + runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-16vcpu-ubuntu-2404' || 'linux-x64-8-core' }} |
| 77 | + timeout-minutes: 25 |
| 78 | + strategy: |
| 79 | + fail-fast: false |
| 80 | + matrix: |
| 81 | + cache: ['off', 'on'] |
| 82 | + services: |
| 83 | + postgres: |
| 84 | + image: pgvector/pgvector:pg17 |
| 85 | + env: |
| 86 | + POSTGRES_USER: postgres |
| 87 | + POSTGRES_PASSWORD: postgres |
| 88 | + POSTGRES_DB: sim_test |
| 89 | + ports: ['5432:5432'] |
| 90 | + options: --health-cmd "pg_isready -U postgres -d sim_test" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 91 | + redis: |
| 92 | + image: redis:8.2-alpine |
| 93 | + ports: ['6379:6379'] |
| 94 | + options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 95 | + env: |
| 96 | + CI_PERSISTENT_CACHE_TRIAL: ${{ matrix.cache }} |
| 97 | + NEXT_PUBLIC_APP_URL: http://localhost:3000 |
| 98 | + BETTER_AUTH_URL: http://localhost:3000 |
| 99 | + BETTER_AUTH_SECRET: compiler-cache-trial-secret-at-least-32-characters |
| 100 | + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/sim_test |
| 101 | + REDIS_URL: redis://127.0.0.1:6379 |
| 102 | + STRIPE_SECRET_KEY: dummy_key_for_ci_only |
| 103 | + STRIPE_WEBHOOK_SECRET: dummy_secret_for_ci_only |
| 104 | + RESEND_API_KEY: dummy_key_for_ci_only |
| 105 | + AWS_REGION: us-west-2 |
| 106 | + ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' |
| 107 | + NEXT_BUILD_SKIP_TYPE_CHECK: 'true' |
| 108 | + NEXT_BUILD_SKIP_SOURCE_MAPS: 'true' |
| 109 | + NODE_OPTIONS: --no-warnings --max-old-space-size=8192 |
| 110 | + steps: |
| 111 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 112 | + - uses: ./.github/actions/setup |
| 113 | + with: |
| 114 | + provider: github |
| 115 | + - name: Mount isolated trial compiler state |
| 116 | + if: matrix.cache == 'on' |
| 117 | + uses: ./.github/actions/cache |
| 118 | + with: |
| 119 | + provider: ${{ vars.CI_PROVIDER }} |
| 120 | + key: ${{ github.repository }}-compiler-requalification-${{ github.run_id }} |
| 121 | + path: ./apps/sim/.next/cache |
| 122 | + save-suffix: -${{ github.job }} |
| 123 | + - name: Provision disposable application infrastructure |
| 124 | + working-directory: packages/db |
| 125 | + run: | |
| 126 | + bun -e 'import postgres from "postgres"; const sql = postgres(process.env.DATABASE_URL); for (const extension of ["vector", "btree_gin", "pg_trgm"]) await sql`CREATE EXTENSION IF NOT EXISTS ${sql(extension)}`; await sql.end()' |
| 127 | + bun run db:migrate |
| 128 | + - name: Compile and serve actual transitive metadata |
| 129 | + run: python3 .github/scripts/compiler-cache-trial.py build |
| 130 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 131 | + if: always() |
| 132 | + with: |
| 133 | + name: compiler-cache-${{ github.job }}-${{ matrix.cache }} |
| 134 | + path: | |
| 135 | + ${{ runner.temp }}/cache-build-proof.json |
| 136 | + ${{ runner.temp }}/compile-time.txt |
| 137 | + ${{ runner.temp }}/compile.log |
| 138 | + ${{ runner.temp }}/server.log |
| 139 | + changed: |
| 140 | + name: changed (${{ matrix.cache }}) |
| 141 | + needs: [warm, decide] |
| 142 | + if: needs.decide.outputs.qualifies == 'true' |
| 143 | + runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-16vcpu-ubuntu-2404' || 'linux-x64-8-core' }} |
| 144 | + timeout-minutes: 25 |
| 145 | + strategy: |
| 146 | + fail-fast: false |
| 147 | + matrix: |
| 148 | + cache: ['off', 'on'] |
| 149 | + services: |
| 150 | + postgres: |
| 151 | + image: pgvector/pgvector:pg17 |
| 152 | + env: |
| 153 | + POSTGRES_USER: postgres |
| 154 | + POSTGRES_PASSWORD: postgres |
| 155 | + POSTGRES_DB: sim_test |
| 156 | + ports: ['5432:5432'] |
| 157 | + options: --health-cmd "pg_isready -U postgres -d sim_test" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 158 | + redis: |
| 159 | + image: redis:8.2-alpine |
| 160 | + ports: ['6379:6379'] |
| 161 | + options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 162 | + env: |
| 163 | + CI_PERSISTENT_CACHE_TRIAL: ${{ matrix.cache }} |
| 164 | + NEXT_PUBLIC_APP_URL: http://localhost:3000 |
| 165 | + BETTER_AUTH_URL: http://localhost:3000 |
| 166 | + BETTER_AUTH_SECRET: compiler-cache-trial-secret-at-least-32-characters |
| 167 | + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/sim_test |
| 168 | + REDIS_URL: redis://127.0.0.1:6379 |
| 169 | + STRIPE_SECRET_KEY: dummy_key_for_ci_only |
| 170 | + STRIPE_WEBHOOK_SECRET: dummy_secret_for_ci_only |
| 171 | + RESEND_API_KEY: dummy_key_for_ci_only |
| 172 | + AWS_REGION: us-west-2 |
| 173 | + ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' |
| 174 | + NEXT_BUILD_SKIP_TYPE_CHECK: 'true' |
| 175 | + NEXT_BUILD_SKIP_SOURCE_MAPS: 'true' |
| 176 | + NODE_OPTIONS: --no-warnings --max-old-space-size=8192 |
| 177 | + steps: |
| 178 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 179 | + - uses: ./.github/actions/setup |
| 180 | + with: |
| 181 | + provider: github |
| 182 | + - name: Mount isolated trial compiler state |
| 183 | + if: matrix.cache == 'on' |
| 184 | + uses: ./.github/actions/cache |
| 185 | + with: |
| 186 | + provider: ${{ vars.CI_PROVIDER }} |
| 187 | + key: ${{ github.repository }}-compiler-requalification-${{ github.run_id }} |
| 188 | + path: ./apps/sim/.next/cache |
| 189 | + save-suffix: -${{ github.job }} |
| 190 | + - name: Provision disposable application infrastructure |
| 191 | + working-directory: packages/db |
| 192 | + run: | |
| 193 | + bun -e 'import postgres from "postgres"; const sql = postgres(process.env.DATABASE_URL); for (const extension of ["vector", "btree_gin", "pg_trgm"]) await sql`CREATE EXTENSION IF NOT EXISTS ${sql(extension)}`; await sql.end()' |
| 194 | + bun run db:migrate |
| 195 | + - name: Compile and serve actual transitive metadata |
| 196 | + run: python3 .github/scripts/compiler-cache-trial.py build |
| 197 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 198 | + if: always() |
| 199 | + with: |
| 200 | + name: compiler-cache-${{ github.job }}-${{ matrix.cache }} |
| 201 | + path: | |
| 202 | + ${{ runner.temp }}/cache-build-proof.json |
| 203 | + ${{ runner.temp }}/compile-time.txt |
| 204 | + ${{ runner.temp }}/compile.log |
| 205 | + ${{ runner.temp }}/server.log |
| 206 | + reverted: |
| 207 | + name: reverted (${{ matrix.cache }}) |
| 208 | + needs: [changed] |
| 209 | + runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-16vcpu-ubuntu-2404' || 'linux-x64-8-core' }} |
| 210 | + timeout-minutes: 25 |
| 211 | + strategy: |
| 212 | + fail-fast: false |
| 213 | + matrix: |
| 214 | + cache: ['off', 'on'] |
| 215 | + services: |
| 216 | + postgres: |
| 217 | + image: pgvector/pgvector:pg17 |
| 218 | + env: |
| 219 | + POSTGRES_USER: postgres |
| 220 | + POSTGRES_PASSWORD: postgres |
| 221 | + POSTGRES_DB: sim_test |
| 222 | + ports: ['5432:5432'] |
| 223 | + options: --health-cmd "pg_isready -U postgres -d sim_test" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 224 | + redis: |
| 225 | + image: redis:8.2-alpine |
| 226 | + ports: ['6379:6379'] |
| 227 | + options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 10 |
| 228 | + env: |
| 229 | + CI_PERSISTENT_CACHE_TRIAL: ${{ matrix.cache }} |
| 230 | + NEXT_PUBLIC_APP_URL: http://localhost:3000 |
| 231 | + BETTER_AUTH_URL: http://localhost:3000 |
| 232 | + BETTER_AUTH_SECRET: compiler-cache-trial-secret-at-least-32-characters |
| 233 | + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/sim_test |
| 234 | + REDIS_URL: redis://127.0.0.1:6379 |
| 235 | + STRIPE_SECRET_KEY: dummy_key_for_ci_only |
| 236 | + STRIPE_WEBHOOK_SECRET: dummy_secret_for_ci_only |
| 237 | + RESEND_API_KEY: dummy_key_for_ci_only |
| 238 | + AWS_REGION: us-west-2 |
| 239 | + ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' |
| 240 | + NEXT_BUILD_SKIP_TYPE_CHECK: 'true' |
| 241 | + NEXT_BUILD_SKIP_SOURCE_MAPS: 'true' |
| 242 | + NODE_OPTIONS: --no-warnings --max-old-space-size=8192 |
| 243 | + steps: |
| 244 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 245 | + - uses: ./.github/actions/setup |
| 246 | + with: |
| 247 | + provider: github |
| 248 | + - name: Mount isolated trial compiler state |
| 249 | + if: matrix.cache == 'on' |
| 250 | + uses: ./.github/actions/cache |
| 251 | + with: |
| 252 | + provider: ${{ vars.CI_PROVIDER }} |
| 253 | + key: ${{ github.repository }}-compiler-requalification-${{ github.run_id }} |
| 254 | + path: ./apps/sim/.next/cache |
| 255 | + save-suffix: -${{ github.job }} |
| 256 | + - name: Provision disposable application infrastructure |
| 257 | + working-directory: packages/db |
| 258 | + run: | |
| 259 | + bun -e 'import postgres from "postgres"; const sql = postgres(process.env.DATABASE_URL); for (const extension of ["vector", "btree_gin", "pg_trgm"]) await sql`CREATE EXTENSION IF NOT EXISTS ${sql(extension)}`; await sql.end()' |
| 260 | + bun run db:migrate |
| 261 | + - name: Compile and serve actual transitive metadata |
| 262 | + run: python3 .github/scripts/compiler-cache-trial.py build |
| 263 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 264 | + if: always() |
| 265 | + with: |
| 266 | + name: compiler-cache-${{ github.job }}-${{ matrix.cache }} |
| 267 | + path: | |
| 268 | + ${{ runner.temp }}/cache-build-proof.json |
| 269 | + ${{ runner.temp }}/compile-time.txt |
| 270 | + ${{ runner.temp }}/compile.log |
| 271 | + ${{ runner.temp }}/server.log |
| 272 | + decide: |
| 273 | + needs: warm |
| 274 | + runs-on: ubuntu-24.04 |
| 275 | + permissions: |
| 276 | + contents: read |
| 277 | + actions: read |
| 278 | + outputs: |
| 279 | + qualifies: ${{ steps.decision.outputs.qualifies }} |
| 280 | + steps: |
| 281 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 282 | + - id: decision |
| 283 | + env: |
| 284 | + GH_TOKEN: ${{ github.token }} |
| 285 | + run: python3 .github/scripts/compiler-cache-trial.py decide |
| 286 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 287 | + with: |
| 288 | + name: compiler-cache-decision |
| 289 | + path: ${{ runner.temp }}/cache-decision.json |
| 290 | + cleanup: |
| 291 | + needs: [cold, warm, decide, changed, reverted] |
| 292 | + if: always() && !cancelled() && (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') |
| 293 | + runs-on: blacksmith-2vcpu-ubuntu-2404 |
| 294 | + steps: |
| 295 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 296 | + - uses: ./.github/actions/cache |
| 297 | + with: |
| 298 | + provider: ${{ vars.CI_PROVIDER }} |
| 299 | + key: ${{ github.repository }}-compiler-requalification-${{ github.run_id }} |
| 300 | + path: ./apps/sim/.next/cache |
| 301 | + - name: Remove only this completed trial's compiler state |
| 302 | + run: | |
| 303 | + python3 - <<'PYCODE' |
| 304 | + from pathlib import Path |
| 305 | + import shutil |
| 306 | + p=Path('apps/sim/.next/cache') |
| 307 | + for child in p.iterdir(): |
| 308 | + if child.is_dir():shutil.rmtree(child) |
| 309 | + else:child.unlink() |
| 310 | + PYCODE |
0 commit comments