CI – Templates Nightly #301
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| env: | |
| EXTENSION_AUTHOR_MODE: development | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v4 | |
| 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: '20' | |
| - name: Compile | |
| run: pnpm compile | |
| - name: Hydrate templates from examples repo | |
| run: bash scripts/hydrate-templates-from-examples.sh | |
| - name: Install Playwright Chromium | |
| 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 | |
| nightly-edge: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 45 | |
| env: | |
| EXTENSION_AUTHOR_MODE: development | |
| EXTENSION_AUTO_EXIT_MS: '8000' | |
| EXTENSION_FORCE_KILL_MS: '12000' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v4 | |
| 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: '20' | |
| - name: Compile | |
| run: pnpm compile | |
| - name: Hydrate templates from examples repo | |
| run: bash scripts/hydrate-templates-from-examples.sh | |
| - name: Install Playwright Chromium | |
| 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 | |
| - name: Dev smoke – edge (Chromium) | |
| run: pnpm extension dev templates/typescript --browser edge --chromium-binary "$CHROMIUM_BIN" --profile false --no-open --port 0 | |
| nightly-firefox: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 45 | |
| env: | |
| EXTENSION_AUTHOR_MODE: development | |
| EXTENSION_AUTO_EXIT_MS: '8000' | |
| EXTENSION_FORCE_KILL_MS: '12000' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v4 | |
| 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: '20' | |
| - name: Compile | |
| run: pnpm compile | |
| - name: Hydrate templates from examples repo | |
| run: bash scripts/hydrate-templates-from-examples.sh | |
| - name: Install Playwright Firefox | |
| # 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 | |
| - name: Dev smoke – firefox (Gecko) | |
| run: pnpm extension dev templates/typescript --browser firefox --gecko-binary "$FIREFOX_BIN" --profile false --no-open --port 0 |