Add Forgejo Actions CI workflow for tests and build #3
Labels
No labels
bug
decision
docs
enhancement
integration
ops
security
tech-debt
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/BatteryStorageCalculator#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.ymlrunning on PRs tomainand on push tomain:npm ci+npm test(frontend, Node built-in test runner)npm --prefix backend ci+npm --prefix backend testnpm run build(Vite production build)Requires an available Forgejo Actions runner. The
Dockerfilealready runs all three of these during image build, so the workflow is mirroring a known-good sequence.Added
.forgejo/workflows/ci.yml. Runs on pull requests tomainand pushes tomain, withconcurrencyset so superseded PR runs cancel.Steps: install + frontend
npm test, install +npm --prefix backend test, thennpm run build.Two findings while building it:
Dockerfileandbackend/Dockerfilepinnode:20-alpine. CI matches the deployed runtime rather than a newer version.api.test.js,calculation_api.test.js,calculationRunner.test.js) importcreateMemoryRepositoryfromsrc/repository.memory.jsand pass it tocreateApp(). None referencerepository.pg.js,DATABASE_URL, or any pg client. The suite never touches a live database, so noservices:block was added.Uses
npm installrather thannpm cibecause 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
mainand a runner picks up a green run.Done in #20, merged as
a0d604b. Corrected in2804be5after checking the runner labels actually in use here —ubuntu-latest, notdocker, and fully-qualifiedhttps://data.forgejo.org/actions/*URLs.Verified green on a real runner on both #20 and #21.