Add Forgejo Actions CI workflow for tests and build #3

Closed
opened 2026-07-17 01:17:53 +00:00 by claude-bot · 2 comments
Contributor

The repo has no CI. Nothing runs the test suites or the production build on push or PR, which is the main reason Renovate auto-merge is currently unsafe.

Add .forgejo/workflows/ci.yml running on PRs to main and on push to main:

  • npm ci + npm test (frontend, Node built-in test runner)
  • npm --prefix backend ci + npm --prefix backend test
  • npm run build (Vite production build)

Requires an available Forgejo Actions runner. The Dockerfile already runs all three of these during image build, so the workflow is mirroring a known-good sequence.

The repo has no CI. Nothing runs the test suites or the production build on push or PR, which is the main reason Renovate auto-merge is currently unsafe. Add `.forgejo/workflows/ci.yml` running on PRs to `main` and on push to `main`: - `npm ci` + `npm test` (frontend, Node built-in test runner) - `npm --prefix backend ci` + `npm --prefix backend test` - `npm run build` (Vite production build) Requires an available Forgejo Actions runner. The `Dockerfile` already runs all three of these during image build, so the workflow is mirroring a known-good sequence.
Author
Contributor

Added .forgejo/workflows/ci.yml. Runs on pull requests to main and pushes to main, with concurrency set so superseded PR runs cancel.

Steps: install + frontend npm test, install + npm --prefix backend test, then npm run build.

Two findings while building it:

  • Node 20, not 22. Both Dockerfile and backend/Dockerfile pin node:20-alpine. CI matches the deployed runtime rather than a newer version.
  • No Postgres service needed. All three backend test files (api.test.js, calculation_api.test.js, calculationRunner.test.js) import createMemoryRepository from src/repository.memory.js and pass it to createApp(). None reference repository.pg.js, DATABASE_URL, or any pg client. The suite never touches a live database, so no services: block was added.

Uses npm install rather than npm ci because no lockfiles exist — see #19, which should land before auto-merge is enabled.

Staged in the working tree; not yet committed. Closing when this lands on main and a runner picks up a green run.

Added `.forgejo/workflows/ci.yml`. Runs on pull requests to `main` and pushes to `main`, with `concurrency` set so superseded PR runs cancel. Steps: install + frontend `npm test`, install + `npm --prefix backend test`, then `npm run build`. Two findings while building it: - **Node 20, not 22.** Both `Dockerfile` and `backend/Dockerfile` pin `node:20-alpine`. CI matches the deployed runtime rather than a newer version. - **No Postgres service needed.** All three backend test files (`api.test.js`, `calculation_api.test.js`, `calculationRunner.test.js`) import `createMemoryRepository` from `src/repository.memory.js` and pass it to `createApp()`. None reference `repository.pg.js`, `DATABASE_URL`, or any pg client. The suite never touches a live database, so no `services:` block was added. Uses `npm install` rather than `npm ci` because no lockfiles exist — see #19, which should land before auto-merge is enabled. Staged in the working tree; not yet committed. Closing when this lands on `main` and a runner picks up a green run.
Author
Contributor

Done in #20, merged as a0d604b. Corrected in 2804be5 after checking the runner labels actually in use here — ubuntu-latest, not docker, and fully-qualified https://data.forgejo.org/actions/* URLs.

Verified green on a real runner on both #20 and #21.

Done in #20, merged as `a0d604b`. Corrected in `2804be5` after checking the runner labels actually in use here — `ubuntu-latest`, not `docker`, and fully-qualified `https://data.forgejo.org/actions/*` URLs. **Verified green on a real runner** on both #20 and #21.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/BatteryStorageCalculator#3
No description provided.