ci: local pre-push hook instead of GH Actions (private repo)
- remove .github/workflows/ci.yml - add .githooks/pre-push: runs npm run test:all - git config core.hooksPath .githooks (set) - docs/DEVELOPMENT.md: document local pipeline Private repo = no free Actions. Revisit when public.
This commit is contained in:
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# pre-push: run test suites before push. Skip with --no-verify.
|
||||||
|
echo "[pre-push] running tests..."
|
||||||
|
npm run test:all || { echo "[pre-push] tests failed. push aborted. (skip: git push --no-verify)"; exit 1; }
|
||||||
|
exit 0
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, rework-backend]
|
|
||||||
pull_request:
|
|
||||||
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
|
|
||||||
- name: shared tests
|
|
||||||
run: npm test --workspace shared
|
|
||||||
- name: server tests
|
|
||||||
run: npm test --workspace server
|
|
||||||
+16
-5
@@ -79,12 +79,23 @@ What each runs:
|
|||||||
|
|
||||||
Server tests use `--forceExit` (open WS handles). Tests spin server on random port, in-memory sqlite, tear down per test.
|
Server tests use `--forceExit` (open WS handles). Tests spin server on random port, in-memory sqlite, tear down per test.
|
||||||
|
|
||||||
### CI
|
### Local pipeline (pre-push hook)
|
||||||
|
|
||||||
`.github/workflows/ci.yml` runs on push/PR to `main` + `rework-backend`:
|
Private repo = no free GitHub Actions. Tests run locally via git hook.
|
||||||
- `npm ci`
|
|
||||||
- `shared` tests
|
`.githooks/pre-push` runs `npm run test:all` before every push.
|
||||||
- `server` tests
|
|
||||||
|
Enable on clone (do once):
|
||||||
|
```bash
|
||||||
|
git config core.hooksPath .githooks
|
||||||
|
```
|
||||||
|
|
||||||
|
Already configured on this checkout. Skip with:
|
||||||
|
```bash
|
||||||
|
git push --no-verify
|
||||||
|
```
|
||||||
|
|
||||||
|
Future: when repo goes public, free GH Actions viable. Then add `.github/workflows/ci.yml`.
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user