|
| 1 | +name: ci-source-map-trial |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [codex/ci-next-build-trial] |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | +jobs: |
| 8 | + qualify: |
| 9 | + runs-on: ubuntu-24.04 |
| 10 | + timeout-minutes: 15 |
| 11 | + env: |
| 12 | + NEXT_PUBLIC_APP_URL: http://localhost:3000 |
| 13 | + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/simstudio |
| 14 | + STRIPE_SECRET_KEY: dummy_key_for_ci_only |
| 15 | + STRIPE_WEBHOOK_SECRET: dummy_secret_for_ci_only |
| 16 | + RESEND_API_KEY: dummy_key_for_ci_only |
| 17 | + AWS_REGION: us-west-2 |
| 18 | + ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' |
| 19 | + NEXT_BUILD_SKIP_TYPE_CHECK: 'true' |
| 20 | + NODE_OPTIONS: --no-warnings --max-old-space-size=8192 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 23 | + - uses: ./.github/actions/setup |
| 24 | + with: |
| 25 | + provider: github |
| 26 | + - run: python3 .github/scripts/source-map-config-proof.py |
| 27 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 28 | + if: always() |
| 29 | + with: |
| 30 | + name: source-map-config-proof |
| 31 | + path: ${{ runner.temp }}/source-map-config-report.json |
| 32 | + build: |
| 33 | + needs: qualify |
| 34 | + runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-16vcpu-ubuntu-2404' || 'linux-x64-8-core' }} |
| 35 | + timeout-minutes: 25 |
| 36 | + strategy: |
| 37 | + fail-fast: false |
| 38 | + matrix: |
| 39 | + maps: [baseline, candidate] |
| 40 | + sample: [1, 2] |
| 41 | + env: |
| 42 | + NEXT_PUBLIC_APP_URL: http://localhost:3000 |
| 43 | + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/simstudio |
| 44 | + STRIPE_SECRET_KEY: dummy_key_for_ci_only |
| 45 | + STRIPE_WEBHOOK_SECRET: dummy_secret_for_ci_only |
| 46 | + RESEND_API_KEY: dummy_key_for_ci_only |
| 47 | + AWS_REGION: us-west-2 |
| 48 | + ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' |
| 49 | + NEXT_BUILD_SKIP_TYPE_CHECK: 'true' |
| 50 | + NODE_OPTIONS: --no-warnings --max-old-space-size=8192 |
| 51 | + NEXT_BUILD_SKIP_SOURCE_MAPS: ${{ matrix.maps == 'candidate' && 'true' || 'false' }} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 54 | + - uses: ./.github/actions/setup |
| 55 | + with: |
| 56 | + provider: github |
| 57 | + - name: Compile the complete application without output cache reuse |
| 58 | + run: /usr/bin/time -v -o "$RUNNER_TEMP/build-time.txt" bunx turbo run build --filter=@sim/app --force |
| 59 | + - name: Record compiled source-map mode and route coverage |
| 60 | + run: | |
| 61 | + python3 - <<'PYCODE' |
| 62 | + import os,json |
| 63 | + from pathlib import Path |
| 64 | + root=Path('apps/sim/.next');config=json.loads((root/'required-server-files.json').read_text())['config'] |
| 65 | + maps=list((root/'static').rglob('*.map'));expected=os.environ['NEXT_BUILD_SKIP_SOURCE_MAPS']!='true' |
| 66 | + report={'mapsEnabled':config['productionBrowserSourceMaps'],'browserMapFiles':len(maps),'browserMapBytes':sum(p.stat().st_size for p in maps),'staticBytes':sum(p.stat().st_size for p in (root/'static').rglob('*') if p.is_file()),'appRoutes':json.loads((root/'server/app-paths-manifest.json').read_text()),'source':os.environ['GITHUB_SHA']} |
| 67 | + Path(os.environ['RUNNER_TEMP'],'build-proof.json').write_text(json.dumps(report,indent=2)) |
| 68 | + assert report['mapsEnabled']==expected |
| 69 | + assert bool(maps)==expected |
| 70 | + PYCODE |
| 71 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 |
| 72 | + if: always() |
| 73 | + with: |
| 74 | + name: source-map-${{ matrix.maps }}-${{ matrix.sample }} |
| 75 | + path: | |
| 76 | + ${{ runner.temp }}/build-time.txt |
| 77 | + ${{ runner.temp }}/build-proof.json |
0 commit comments