name: CI – Templates Nightly on: schedule: - cron: '0 3 * * *' workflow_dispatch: permissions: contents: read jobs: nightly-chromium: runs-on: ubuntu-22.04 timeout-minutes: 60 permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write env: EXTENSION_AUTHOR_MODE: development steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.pnpm-store ~/.cache/ms-playwright key: nightly-chromium-${{ runner.os }}-20-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | nightly-chromium-${{ runner.os }}-20- - uses: ./.github/actions/setup with: node-version: '22' - name: Compile run: pnpm compile - name: Hydrate templates from examples repo run: bash scripts/hydrate-templates-from-examples.sh - name: Install Playwright Chromium timeout-minutes: 10 run: npx playwright install --with-deps chromium - name: Run CLI Tests run: pnpm test:cli - name: Build examples (chromium) run: | pnpm extension build templates/typescript --browser chromium --silent true pnpm extension build templates/react --browser chromium --silent true pnpm extension build templates/svelte --browser chromium --silent true pnpm extension build templates/vue --browser chromium --silent true - name: Run Dev Tests run: pnpm test:dev - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | export EXTENSION_AUTHOR_MODE=development bash scripts/hydrate-templates-from-examples.sh pnpm test:cli pnpm extension build templates/typescript --browser chromium --silent true pnpm test:dev run: bash scripts/report-red-lane.sh "Nightly chromium" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly chromium" nightly-edge: runs-on: ubuntu-22.04 timeout-minutes: 45 permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write env: EXTENSION_AUTHOR_MODE: development EXTENSION_FORCE_KILL_MS: '12000' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.pnpm-store ~/.cache/ms-playwright key: nightly-edge-${{ runner.os }}-20-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | nightly-edge-${{ runner.os }}-20- - uses: ./.github/actions/setup with: node-version: '22' - name: Compile run: pnpm compile - name: Hydrate templates from examples repo run: bash scripts/hydrate-templates-from-examples.sh - name: Install Playwright Chromium timeout-minutes: 10 run: npx playwright install --with-deps chromium - name: Resolve Chromium binary # `@playwright/test` is the workspace-root devDependency and # re-exports the browser launchers. `playwright-core` is a # transitive dep that pnpm doesn't hoist to the root, so an # `import("playwright-core")` from the workspace root fails with # ERR_MODULE_NOT_FOUND. run: | CHROMIUM_BIN="$(node -e 'import("@playwright/test").then((m) => console.log(m.chromium.executablePath())).catch((err) => { console.error(err); process.exit(1); })')" echo "CHROMIUM_BIN=$CHROMIUM_BIN" >> "$GITHUB_ENV" - name: Build examples (edge) run: | pnpm extension build templates/typescript --browser edge --silent true pnpm extension build templates/react --browser edge --silent true pnpm extension build templates/svelte --browser edge --silent true pnpm extension build templates/vue --browser edge --silent true # A headful browser on the runner needs an X server, without one it # exits at once. The smoke passes only once ready.json shows the # extension attached in the browser, an exit 0 from dev proves nothing. - name: Dev smoke – edge (Chromium) run: xvfb-run -a node scripts/nightly-dev-smoke.mjs templates/typescript --browser edge --chromium-binary "$CHROMIUM_BIN" --profile false --no-open --port 0 - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | export EXTENSION_AUTHOR_MODE=development EXTENSION_FORCE_KILL_MS=12000 bash scripts/hydrate-templates-from-examples.sh pnpm extension build templates/typescript --browser edge --silent true xvfb-run -a node scripts/nightly-dev-smoke.mjs templates/typescript --browser edge --chromium-binary "" --profile false --no-open --port 0 run: bash scripts/report-red-lane.sh "Nightly edge" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly edge" nightly-firefox: runs-on: ubuntu-22.04 timeout-minutes: 45 permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write env: EXTENSION_AUTHOR_MODE: development EXTENSION_FORCE_KILL_MS: '12000' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.pnpm-store ~/.cache/ms-playwright key: nightly-firefox-${{ runner.os }}-20-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | nightly-firefox-${{ runner.os }}-20- - uses: ./.github/actions/setup with: node-version: '22' - name: Compile run: pnpm compile - name: Hydrate templates from examples repo run: bash scripts/hydrate-templates-from-examples.sh - name: Install Playwright Firefox timeout-minutes: 10 # On Ubuntu 24.04 (noble), the `firefox` apt package is a snap # transitional shim. `playwright install --with-deps firefox` # ends up upgrading that shim, which triggers `Installing the # firefox snap` and hangs ~50 minutes on snap-store contact in # GitHub-hosted runners. Holding the apt package keeps it pinned # so the `--with-deps` apt-get pass installs only the system # libraries Firefox needs at runtime; the actual Firefox binary # used by Playwright is downloaded from playwright.dev's CDN # into ~/.cache/ms-playwright and never touches snap. run: | sudo apt-mark hold firefox npx playwright install --with-deps firefox - name: Resolve Firefox binary # See `Resolve Chromium binary` above for why we import # `@playwright/test` here instead of `playwright-core`. run: | FIREFOX_BIN="$(node -e 'import("@playwright/test").then((m) => console.log(m.firefox.executablePath())).catch((err) => { console.error(err); process.exit(1); })')" echo "FIREFOX_BIN=$FIREFOX_BIN" >> "$GITHUB_ENV" - name: Build examples (firefox) run: | pnpm extension build templates/typescript --browser firefox --silent true pnpm extension build templates/react --browser firefox --silent true pnpm extension build templates/svelte --browser firefox --silent true pnpm extension build templates/vue --browser firefox --silent true # Same X server and load proof as the edge smoke. The managed profile is # the only one the add-on installs into, Firefox's own has no debugger. - name: Dev smoke – firefox (Gecko) run: xvfb-run -a node scripts/nightly-dev-smoke.mjs templates/typescript --browser firefox --gecko-binary "$FIREFOX_BIN" --no-open --port 0 - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | export EXTENSION_AUTHOR_MODE=development EXTENSION_FORCE_KILL_MS=12000 bash scripts/hydrate-templates-from-examples.sh pnpm extension build templates/typescript --browser firefox --silent true xvfb-run -a node scripts/nightly-dev-smoke.mjs templates/typescript --browser firefox --gecko-binary "" --no-open --port 0 run: bash scripts/report-red-lane.sh "Nightly firefox" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly firefox" nightly-session-lifecycle: # Control-channel lifecycle across process boundaries: dev-server crash + # restart against a kept profile (#484 stale-SW resync), dist wipe under # an external profile, verbs + doctor against each state. Default trio # only, two-browser/idle-window stay local until this job has a streak. runs-on: ubuntu-22.04 timeout-minutes: 45 permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write env: EXTENSION_AUTHOR_MODE: development EXTENSION_BROWSER_FLAGS: '--headless=new' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.pnpm-store key: nightly-lifecycle-${{ runner.os }}-20-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | nightly-lifecycle-${{ runner.os }}-20- - uses: ./.github/actions/setup with: node-version: '22' - name: Compile run: pnpm compile - name: Session lifecycle exercise run: xvfb-run -a pnpm smoke:session-lifecycle - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | export EXTENSION_AUTHOR_MODE=development EXTENSION_BROWSER_FLAGS='--headless=new' pnpm compile pnpm smoke:session-lifecycle run: bash scripts/report-red-lane.sh "Nightly session lifecycle" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly session lifecycle" bundled-template-drift: # Early warning for discussion #478: the bundled `javascript` template # (programs/create/templates/javascript) must track extension-js/templates. # publish-release.yml runs the same check as a hard release gate. runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check bundled create template drift run: bash scripts/check-bundled-template-drift.sh - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | bash scripts/check-bundled-template-drift.sh run: bash scripts/report-red-lane.sh "Nightly bundled template drift" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly bundled template drift" examples-catalog: # The merge gate scaffolds from the bundled template over loopback, so the # codeload fetch and the catalog lookup only run here, against the real # pinned examples ref. A breakage there shows up within a day, not at the # next release. runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup with: node-version: '22' - name: Scaffold from the real templates catalog run: pnpm test:remote - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | pnpm test:remote run: bash scripts/report-red-lane.sh "Nightly templates catalog" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly templates catalog" # Bun and Deno already get a build and a headless dev run on every pull # request. A real browser launch is the one thing that lane cannot carry, # because browser flakiness has no business in a merge gate, so it lives # here instead. Without this, "runs on Bun" rested on a macOS laptop. nightly-runtimes: name: ${{ matrix.runtime }} runtime + ${{ matrix.browser }} runs-on: ubuntu-22.04 timeout-minutes: 45 strategy: fail-fast: false matrix: runtime: [bun, deno] browser: [chromium, firefox] permissions: contents: read # report-red-lane.sh opens or comments on the red lane issue issues: write env: EXTENSION_AUTHOR_MODE: development steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.pnpm-store ~/.cache/ms-playwright key: nightly-runtimes-${{ matrix.browser }}-${{ runner.os }}-20-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | nightly-runtimes-${{ matrix.browser }}-${{ runner.os }}-20- - uses: ./.github/actions/setup with: node-version: '22' - name: Setup Bun if: matrix.runtime == 'bun' uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest - name: Setup Deno if: matrix.runtime == 'deno' uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5 with: deno-version: v2.x - name: Compile run: | pnpm --filter extension-develop compile pnpm --filter extension compile - name: Install Playwright Chromium timeout-minutes: 10 if: matrix.browser == 'chromium' run: npx playwright install --with-deps chromium # The apt `firefox` package on Ubuntu is a snap transitional shim, and # letting `--with-deps` upgrade it hangs the runner for most of an hour # on snap-store contact. Holding it pins the shim so the apt pass installs # only runtime libraries, and Playwright's own Firefox comes from its CDN. # The nightly-firefox job above carries the same guard for the same reason. - name: Install Playwright Firefox timeout-minutes: 10 if: matrix.browser == 'firefox' run: | sudo apt-mark hold firefox npx playwright install --with-deps firefox # `@playwright/test` is the workspace-root devDependency that re-exports # the launchers; `playwright-core` is transitive and not hoisted, so # importing it from the root fails with ERR_MODULE_NOT_FOUND. - name: Resolve browser binary env: PW_BROWSER: ${{ matrix.browser }} run: | BIN="$(node -e 'import("@playwright/test").then((m) => console.log(m[process.env.PW_BROWSER].executablePath())).catch((err) => { console.error(err); process.exit(1); })')" echo "RUNTIME_SMOKE_BROWSER_BINARY=$BIN" >> "$GITHUB_ENV" # The smoke runs build, then a headless dev, then the real launch, and # only calls the launch a pass once ready.json shows the extension # attached. A browserPid alone would pass a browser that died at launch. - name: Runtime + browser smoke env: RUNTIME_SMOKE_BROWSER: ${{ matrix.browser }} run: pnpm smoke:${{ matrix.runtime }} - name: Report a red lane if: failure() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RED_LANE_REPRO: | export EXTENSION_AUTHOR_MODE=development RUNTIME_SMOKE_BROWSER=${{ matrix.browser }} export RUNTIME_SMOKE_BROWSER_BINARY="" pnpm --filter extension-develop compile && pnpm --filter extension compile pnpm smoke:${{ matrix.runtime }} run: bash scripts/report-red-lane.sh "Nightly ${{ matrix.runtime }} runtime + ${{ matrix.browser }}" - name: Close the red lane if: success() env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: bash scripts/close-red-lane.sh "Nightly ${{ matrix.runtime }} runtime + ${{ matrix.browser }}"