Run the test suite in Forgejo Actions #16

Merged
matchu merged 3 commits from armin-bot/impress:claude/ci-tests into main 2026-11-08 20:47:54 -08:00
Contributor

Runs the test suite in Forgejo Actions on every pull request, and on every push to main. It uses the runner set up in OpenNeo/openneo-code#1.

What the workflow does

.forgejo/workflows/test.yml, one job on the docker runner label:

  1. Runs in a ruby:3.4.5-bookworm container, with a mariadb:10.11 service container (empty root password, reached as mariadb through DB_HOST/DB_USER, which config/database.yml already reads).
  2. Checks out github.sha with plain git. actions/checkout needs Node, which this image doesn't have, and fetching by SHA works for fork PRs too.
  3. Installs libvips42, because some specs process images with ruby-vips.
  4. Installs Node 22.23.4 from nodejs.org (checksum-verified), then runs yarn install --immutable and yarn build. Request specs render the full layout, so they need the built JS: without it, 15 specs in rate_limits_spec.rb fail. Dev environments hide this because they already have built bundles.
  5. Runs bundle install --local from vendor/cache with frozen on, so it never touches rubygems.org and fails if Gemfile.lock is out of date.
  6. Waits for MariaDB, runs bin/rails db:create db:schema:load (both databases), then bundle exec rspec.

Security

  • Uses no secrets, so it's safe to run on fork PRs. Forgejo holds a fork PR's first run until someone with write access approves it, and fork runs never get secrets. Deploy credentials will go in a separate workflow that only runs on pushes to main.
  • A comment warns never to add ports:. Docker-published ports bypass the runner host's firewall, which would expose the passwordless MariaDB.

Testing

  • Simulated every step by hand in a fresh clone of upstream main, with fresh gem installs: 406 examples, 0 failures (2 pending). A review also ran the suite with CI=true, which turns on eager loading: same result.
  • This PR's own run is the first real test on the runner.

🤖 Generated with Claude Code

https://claude.ai/code/session_014PWWczf6WkuBDdUASWtRcZ

Runs the test suite in Forgejo Actions on every pull request, and on every push to `main`. It uses the runner set up in OpenNeo/openneo-code#1. ## What the workflow does `.forgejo/workflows/test.yml`, one job on the `docker` runner label: 1. Runs in a `ruby:3.4.5-bookworm` container, with a `mariadb:10.11` service container (empty root password, reached as `mariadb` through `DB_HOST`/`DB_USER`, which `config/database.yml` already reads). 2. Checks out `github.sha` with plain git. `actions/checkout` needs Node, which this image doesn't have, and fetching by SHA works for fork PRs too. 3. Installs `libvips42`, because some specs process images with ruby-vips. 4. Installs Node 22.23.4 from nodejs.org (checksum-verified), then runs `yarn install --immutable` and `yarn build`. **Request specs render the full layout, so they need the built JS**: without it, 15 specs in `rate_limits_spec.rb` fail. Dev environments hide this because they already have built bundles. 5. Runs `bundle install --local` from `vendor/cache` with `frozen` on, so it never touches rubygems.org and fails if `Gemfile.lock` is out of date. 6. Waits for MariaDB, runs `bin/rails db:create db:schema:load` (both databases), then `bundle exec rspec`. ## Security - Uses no secrets, so it's safe to run on fork PRs. Forgejo holds a fork PR's first run until someone with write access approves it, and fork runs never get secrets. Deploy credentials will go in a separate workflow that only runs on pushes to `main`. - A comment warns never to add `ports:`. Docker-published ports bypass the runner host's firewall, which would expose the passwordless MariaDB. ## Testing - Simulated every step by hand in a fresh clone of upstream `main`, with fresh gem installs: **406 examples, 0 failures** (2 pending). A review also ran the suite with `CI=true`, which turns on eager loading: same result. - This PR's own run is the first real test on the runner. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014PWWczf6WkuBDdUASWtRcZ
Adds a workflow that runs rspec on every pull request and every push to
main, in a Ruby container with a MariaDB service container. It builds the
JS first, because request specs render the full layout. It uses no
secrets, so it's safe to run on pull requests from forks once they're
approved.

It needs a runner with the `docker` label, which is set up separately in
the openneo-code repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczf6WkuBDdUASWtRcZ
Warn against publishing ports in the CI workflow
Some checks failed
Tests / rspec (pull_request) Failing after 11m6s
227b04bfd8
The runner shares a machine with Forgejo, and Docker-published ports
bypass ufw, so a `ports:` entry would expose the passwordless test
MariaDB to the internet during a run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczf6WkuBDdUASWtRcZ
armin-bot force-pushed claude/ci-tests from 227b04bfd8
Some checks failed
Tests / rspec (pull_request) Failing after 11m6s
to c66c7c2701
All checks were successful
Tests / rspec (pull_request) Successful in 7m21s
2026-11-08 20:28:47 -08:00
Compare
matchu merged commit 140a0379df into main 2026-11-08 20:47:54 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
OpenNeo/impress!16
No description provided.