diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3cdd190 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + - run: npx playwright install --with-deps chromium + - run: node --check github-sortout.user.js + - run: npm test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4980b96 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,47 @@ +# Contributing + +Keep changes small, plain, and easy to audit. + +## Workflow + +Use pull requests for changes to `main`. + +1. Branch from `main`. +2. Make the smallest change that solves the issue. +3. Update docs when behavior, install steps, privacy, or testing changes. +4. Open a pull request with what changed, why, and how it was tested. + +Avoid unrelated cleanup in feature or bugfix PRs. + +## Code + +- Keep the userscript dependency-free unless there is a strong reason. +- Prefer DOM APIs and text nodes over `innerHTML`. +- Do not add GitHub tokens, background services, analytics, or local activity tracking. +- Treat GitHub selectors as unstable. Keep adapters small and covered by fixtures. +- Sorting should only move loaded timeline activity, not the initial issue or PR post. + +## Testing + +Before opening a PR, run: + +```sh +node --check github-sortout.user.js +npm test +``` + +CI runs these same non-live checks on pull requests and pushes to `main`. + +Run the live smoke checks when touching GitHub page selectors or timeline behavior: + +```sh +npm run test:live +``` + +Manual browser testing is still useful for userscript changes, especially in Firefox with Violentmonkey. + +## Releases + +There is no build step and no automatic update channel. + +For a release, update the userscript version, commit through a pull request, merge to `main`, and install from the raw script URL.