Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ jobs:
timeout-minutes: 5
outputs:
console: ${{ steps.filter.outputs.console }}
browsers: ${{ steps.filter.outputs.browsers }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -181,13 +180,6 @@ jobs:
else
echo "console=false" >>"$GITHUB_OUTPUT"
fi
# Most console failures are Firefox- or WebKit-only, so a change to the UI or its
# specs runs every browser; any other change runs Chromium.
if printf '%s\n' "$changed" | grep -q -E '^(ui/|e2e/console/|playwright\.config\.ts$)'; then
echo "browsers=all" >>"$GITHUB_OUTPUT"
else
echo "browsers=chromium" >>"$GITHUB_OUTPUT"
fi

console-lane:
name: Console (${{ matrix.shard }}/4)
Expand Down Expand Up @@ -217,24 +209,11 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Install Playwright browsers
env:
BROWSERS: ${{ needs.changes.outputs.browsers }}
run: |
if [ "$BROWSERS" = chromium ]; then
pnpm exec playwright install --with-deps chromium
else
pnpm exec playwright install --with-deps chromium firefox webkit
fi
run: pnpm exec playwright install --with-deps chromium
- name: Browser lane
env:
BROWSERS: ${{ needs.changes.outputs.browsers }}
SHARD: ${{ matrix.shard }}
run: |
if [ "$BROWSERS" = chromium ]; then
pnpm test:console --project=chromium --shard="$SHARD/4"
else
pnpm test:console --shard="$SHARD/4"
fi
run: pnpm test:console --project=chromium --shard="$SHARD/4"

# why: branch protection requires the check named Console, so this job stands for the sharded
# lane. `always()` makes it report a failure when a shard fails, where a job skipped by a failed
Expand Down
7 changes: 5 additions & 2 deletions src/test-lanes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function ciJobs(ci: string): ReadonlyMap<string, string> {
const CONSOLE_SHARDS_AT_LEAST = 4;

describe("the console lane in CI (.github/workflows/ci.yml)", () => {
it("runs the console lane over a matrix of at least four shards, each passing its `--shard=<i>/<n>` in both browser modes, and the required `Console` check needs that job and fails when it does not pass", () => {
it("runs the console lane over a matrix of at least four Chromium-only shards, and the required `Console` check needs that job and fails when it does not pass", () => {
const ci = readFileSync(join(REPO_ROOT, ".github/workflows/ci.yml"), "utf8");
const jobs = [...ciJobs(ci)];
const lanes = jobs.filter(([, job]) => job.includes("pnpm test:console"));
Expand All @@ -181,7 +181,10 @@ describe("the console lane in CI (.github/workflows/ci.yml)", () => {
CONSOLE_SHARDS_AT_LEAST,
);
const runs = lane.match(/pnpm test:console[^\n]*/g) ?? [];
expect(runs, "the lane's chromium-only and every-browser commands").toHaveLength(2);
expect(runs, "the lane's Chromium-only command").toHaveLength(1);
expect(runs[0]).toContain("--project=chromium");
expect(lane).not.toMatch(/firefox|webkit|macos/i);
expect(lane).toContain("runs-on: ubuntu-24.04");
expect(lane, "the shard index comes from the matrix").toMatch(
/\n {10}SHARD: \$\{\{ matrix\.shard \}\}/,
);
Expand Down
Loading