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
48 changes: 46 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
push:
branches: [main]
paths-ignore: ["docs/**", "**/*.md"]
# No paths-ignore on pull requests: a skipped workflow never reports the required checks, which
# blocks the merge. The `changes` job skips the slow steps instead when only docs changed.
pull_request:
paths-ignore: ["docs/**", "**/*.md"]

concurrency:
group: ci-${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand All @@ -15,8 +16,33 @@ permissions:
contents: read

jobs:
# code is "false" for a pull request that only changes docs/ or Markdown files.
changes:
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
code: ${{ steps.diff.outputs.code }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Check for changes outside docs
id: diff
run: |
if [ "$GITHUB_EVENT_NAME" != "pull_request" ]; then
echo "code=true" >> "$GITHUB_OUTPUT"
elif git diff --name-only HEAD^1 HEAD | grep -qvE '^docs/|\.md$'; then
echo "code=true" >> "$GITHUB_OUTPUT"
else
echo "Only docs changed: lint and format:check run, the build and suites are skipped."
echo "code=false" >> "$GITHUB_OUTPUT"
fi

test:
needs: changes
runs-on: ubuntu-latest
env:
CODE: ${{ needs.changes.outputs.code }}
steps:
- name: Set timings file path
run: echo "TIMINGS=$RUNNER_TEMP/timings.tsv" >> "$GITHUB_ENV"
Expand All @@ -32,13 +58,16 @@ jobs:
npm ci
- name: Get Playwright version
id: playwright
if: env.CODE == 'true'
run: echo "version=$(node -p "require('playwright/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
if: env.CODE == 'true'
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}
- name: Install Chromium
if: env.CODE == 'true'
run: |
start=$(date +%s)
trap 'printf "%s\t%s\n" "Install Chromium" "$(($(date +%s) - start))" >> "$TIMINGS"' EXIT
Expand All @@ -64,16 +93,19 @@ jobs:
trap 'printf "%s\t%s\n" "npm run format:check" "$(($(date +%s) - start))" >> "$TIMINGS"' EXIT
npm run format:check
- name: npm run build
if: env.CODE == 'true'
run: |
start=$(date +%s)
trap 'printf "%s\t%s\n" "npm run build" "$(($(date +%s) - start))" >> "$TIMINGS"' EXIT
npm run build
- name: vitest run --coverage
if: env.CODE == 'true'
run: |
start=$(date +%s)
trap 'printf "%s\t%s\n" "vitest run --coverage" "$(($(date +%s) - start))" >> "$TIMINGS"' EXIT
npx vitest run --coverage --reporter=default --reporter=json --outputFile.json=vitest-report.json
- name: Check committed dist matches the build
if: env.CODE == 'true'
run: |
start=$(date +%s)
trap 'printf "%s\t%s\n" "Check committed dist matches the build" "$(($(date +%s) - start))" >> "$TIMINGS"' EXIT
Expand All @@ -95,8 +127,11 @@ jobs:
} >> "$GITHUB_STEP_SUMMARY"

# The suite against the jQuery support floor, the latest 3.x, and 4.x.
# Branch protection requires each matrix check by name, so a docs-only PR skips the steps, not the
# job: a job skipped by `if` reports one unexpanded "jQuery ${{ matrix.jquery }}" check instead.
jquery:
name: jQuery ${{ matrix.jquery }}
needs: changes
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
Expand All @@ -106,26 +141,35 @@ jobs:
- { jquery: "1.7.2", file: ".jquery/jquery-1.7.2.js" }
- { jquery: "3.7.1", file: "node_modules/jquery/dist/jquery.js" }
- { jquery: "4.0.0", file: "node_modules/jquery4/dist/jquery.js" }
env:
CODE: ${{ needs.changes.outputs.code }}
steps:
- uses: actions/checkout@v7
if: env.CODE == 'true'
- uses: actions/setup-node@v7
if: env.CODE == 'true'
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
if: env.CODE == 'true'
- name: Get Playwright version
id: playwright
if: env.CODE == 'true'
run: echo "version=$(node -p "require('playwright/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
if: env.CODE == 'true'
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}
- run: npx playwright install chromium
if: env.CODE == 'true'
- name: Fetch jQuery 1.7.2
if: matrix.jquery == '1.7.2'
if: env.CODE == 'true' && matrix.jquery == '1.7.2'
run: scripts/fetch-jquery.sh 1.7.2
- name: Run the suite on jQuery ${{ matrix.jquery }}
if: env.CODE == 'true'
run: npx vitest run --project suite
env:
JQUERY_FILE: ${{ matrix.file }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Here are a couple of guidelines that will help you contribute. Before we get sta
### Things to keep in mind

* Smaller PRs are likely to be merged more quickly than bigger changes.
* Every merge needs maintainer review. Feature/community PRs wait until the modernization coverage work is done (see the plan); they are not merged before that gate.
* Every merge needs maintainer review.
* This project is using [Semantic Versioning 2.0.0](http://semver.org/)

## Branching and releases
Expand Down
8 changes: 8 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,13 @@ defaults:
values:
layout: "default"

# Project-internal notes live in the repository, not on the site.
exclude:
- .gitignore
- Gemfile
- Gemfile.lock
- adr/
- agents/
- plans/
- research/
- metrics.md
16 changes: 16 additions & 0 deletions docs/agents/coding-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ Human PR/process stays in `CONTRIBUTING.md`.

Use **[Conventional Commits](https://www.conventionalcommits.org/)**. Each message is **1–3 lines** total (subject plus at most a short body). Prefer the type that matches the change (`fix`, `feat`, `docs`, `test`, `chore`, `refactor`, `ci`, `build`). Omit `Co-authored-by` and similar trailers.

## Public text

Public text is anything a user of the library reads: `README.md`, `CONTRIBUTING.md`, `SECURITY.md`, the
docs site pages, comments in `src/` (they ship in `dist/`), GitHub release notes, security advisories,
and issue, PR and drupal.org comments.

- Write it so it makes sense without the internal notes in `docs/plans/`, `docs/research/`,
`docs/agents/` and `docs/adr/`. Those may be removed or condensed later.
- Don't mention plan phases ("Phase 8"), internal finding IDs (`W1`, `D-09`, `SER-18`, `IFR-122`),
`it.fails` records or probes. Name the behavior, the version, the GHSA or CVE ID, or the GitHub
issue instead.
- Don't link to `docs/plans/` or `docs/research/`. An ADR link is fine where its reasoning helps a
contributor.
- The docs site (`docs/` on `main`) excludes those folders in `docs/_config.yml`. Keep a new
internal folder or file out of it the same way.

## Tests

- **Names:** BDD-style — behavior in plain language (`describe` / `it` or the runner's equivalent), e.g. when X, it should Y.
Expand Down
Loading