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
18 changes: 18 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# GitHub Actions

## CI workflow

[`workflows/ci.yml`](workflows/ci.yml) runs on pull requests and pushes to `master`: install dependencies, `npm run lint`, and `npm test`.

It uses `npm ci` for both the repo root and `src/server`, matching the current lockfile-based setup on `master`.

## Require CI before merging (branch protection)

After this workflow is on the default branch:

1. In the GitHub repo, go to **Settings** → **Branches**.
2. Add or edit a rule for `master`.
3. Enable **Require status checks to pass before merging**.
4. Under **Status checks that are required**, select **CI / ci** (or the job name shown after the first run).

This blocks merging PRs until lint and tests pass.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
pull_request:
branches: [master]
push:
branches: [master]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install root deps
run: npm ci --legacy-peer-deps
- name: Install server deps
run: npm --prefix src/server ci
- name: Lint
run: npm run lint
- name: Test
run: npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"build": "npm --prefix admin run build && NODE_ENV=production webpack --config build/webpack.config.js",
"serve": "cd src/server && NODE_ENV=development node app.js",
"lint": "eslint .",
"test": "node --test \"test/**/*.test.js\""
"test": "node --test"
},
"husky": {
"hooks": {
Expand Down
Loading