diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..cba0df6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +## What changed + +## How I checked it + +- [ ] Ran the checks in CONTRIBUTING.md +- [ ] Added or updated tests if behavior changed diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa12b91 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI +on: + # Pull requests (free on public repos, so contributors see their PR checked), or by hand. + pull_request: + workflow_dispatch: +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + check: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run check + - run: npm test + - run: npm run build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3a885dc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to stackflow-next + +Bug reports, fixes, docs and small features are welcome. + +## Before you start + +Small fixes need no issue. For a larger change, open an issue or a draft pull request first so we can agree on the approach before you spend time on it. + +## Set up + +Use Node.js 20 or newer. + +```bash +git clone https://github.com//stackflow-next.git +cd stackflow-next +npm ci +``` + +## Check your change + +Run the same checks the pull request runs: + +```bash +npm ci +npm run check +npm test +npm run build +``` + +## Open a pull request + +- Branch from `main` and keep one topic per pull request. +- Say what changed and how you checked it. Add or update tests when behavior changes. +- Pull requests run the checks above and a short public-text check (no secrets or personal paths in added lines). A maintainer reviews and merges.