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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
test:
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3", "3.4", "4.0"]
rails: ["7.1", "7.2", "8.0", "8.1"]
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Prepare dummy app database
run: bundle exec rails db:schema:load
working-directory: test/dummy
env:
RAILS_ENV: test
- name: Run tests
run: bundle exec rake test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*.rbc
.rspec_status
Gemfile.lock
/gemfiles/*.lock

# Dummy app
/test/dummy/log/*
Expand Down
18 changes: 17 additions & 1 deletion .okf/development/testing-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,21 @@ so hidden fixtures leak between tests and only fail under some seeds.
# Running

`bundle exec rake test`, against `test/dummy` (part of the test setup; never delete it). Prepare
its DB with `cd test/dummy && bin/rails db:prepare`. Database pitfalls are in
the test DB with `cd test/dummy && RAILS_ENV=test bin/rails db:schema:load` — **not** `db:prepare`,
which also runs `db/seeds.rb` on a fresh DB; the self-contained tests assume an empty DB and ~30 of
them fail against seeded data. Database pitfalls are in
[dev-reload gotchas](/development/dev-reload-gotchas.md).

# CI matrix

`.github/workflows/ci.yml` runs the suite on Ruby 3.2–4.0 × Rails 7.1–8.1 (Ruby 3.1 is out:
Phlex 2.x needs 3.2+). Each Rails version has `gemfiles/rails_X.Y.gemfile`, which pins `rails`
and `eval_gemfile`s the root `Gemfile` so the dev/test groups (RubyUI, auth adapters, kramdown…)
stay in one place.

Keeping the dummy app loadable on the oldest Rails in the matrix:

- `test/dummy/db/schema.rb` is pinned to `ActiveRecord::Schema[7.1]`. A schema dumped by a newer
Rails rewrites the header (`Schema[8.1]`), which Rails 7.1–8.0 reject (`Unknown version`).
- `config.load_defaults [Rails::VERSION::STRING.to_f, 7.2].min` — 7.2 is what the suite was
written against, and Rails 7.1 doesn't know `load_defaults 7.2`.
4 changes: 4 additions & 0 deletions .okf/log.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Update Log

## 2026-11-13
* **Update**: [testing conventions](/development/testing-conventions.md) — CI matrix (Ruby 3.2–4.0 ×
Rails 7.1–8.1), per-Rails gemfiles, `db:schema:load` instead of `db:prepare` for the test DB, and
the dummy-app constraints (`Schema[7.1]`, capped `load_defaults`).

* **Creation**: initial bundle produced from an analysis of the gem's code (v0.1.1) and its
`CLAUDE.md` — architecture, DSL, authorization, frontend and development areas. See
[index](/index.md).
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- CI on GitHub Actions: the full test suite runs on Ruby 3.2, 3.3, 3.4 and 4.0 × Rails 7.1, 7.2,
8.0 and 8.1 (`gemfiles/rails_X.Y.gemfile`). Documented in the README's compatibility matrix.

## [0.1.1] - 2026-11-12

### Changed
Expand Down
11 changes: 10 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@ bundle exec rake test
```

The suite runs against the dummy app in `test/dummy` (which is part of the test setup — do
not delete it). To prepare its database: `cd test/dummy && bin/rails db:prepare`.
not delete it). To prepare its database: `cd test/dummy && RAILS_ENV=test bin/rails db:schema:load`
(not `db:prepare` for the test DB: it also runs `db/seeds.rb`, and the suite expects an empty DB).

**CI matrix** (`.github/workflows/ci.yml`): Ruby 3.2–4.0 × Rails 7.1–8.1, one Gemfile per Rails
version in `gemfiles/rails_X.Y.gemfile` (each pins `rails` and `eval_gemfile`s the root `Gemfile`).
Locally: `BUNDLE_GEMFILE=gemfiles/rails_7.1.gemfile bundle install && … bundle exec rake test`.
To keep the dummy app loadable on every Rails in the matrix:
- `test/dummy/db/schema.rb` must stay `ActiveRecord::Schema[7.1]` — dumping it from a newer Rails
rewrites the header (e.g. `Schema[8.1]`), which older Rails can't load. Fix the header back.
- `config.load_defaults` in `test/dummy/config/application.rb` is `[Rails version, 7.2].min`.

## Dummy app & assets gotchas

Expand Down
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# RubyUI Admin

[![CI](https://github.com/jacksonpires/ruby_ui_admin/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jacksonpires/ruby_ui_admin/actions/workflows/ci.yml)

`ruby_ui_admin` is a Rails admin dashboard engine, rendered with
[RubyUI](https://rubyui.com) (Phlex) components, that even serves its own documentation as HTML
inside your app at `<mount>/docs` (e.g. `/admin/docs`).
Expand Down Expand Up @@ -46,15 +48,34 @@ This makes the admin part of your app's UI rather than a self-contained bundle.

### Compatibility

Tested on **2026-11-10** with the latest releases; the full test suite (252 tests) passes on every
combination below:
| Dependency | Gem requirement |
| ----------- | --------------- |
| Ruby | `>= 3.2` |
| Rails | `>= 7.1` |
| Phlex | phlex-rails `>= 2.0` (tested with Phlex **2.4.1** / phlex-rails **2.4.0**) |
| RubyUI | **1.6.x** components in the host app (tested with **1.6.0**) |

#### CI matrix

The full test suite (252 tests) runs in CI against every combination below.

| Ruby \ Rails | 7.1 | 7.2 | 8.0 | 8.1 |
|--------------|:---:|:---:|:---:|:---:|
| **4.0** | ✅ | ✅ | ✅ | ✅ |
| **3.4** | ✅ | ✅ | ✅ | ✅ |
| **3.3** | ✅ | ✅ | ✅ | ✅ |
| **3.2** | ✅ | ✅ | ✅ | ✅ |

Ruby 3.1 isn't supported because Phlex 2.x (required by `phlex-rails >= 2.0`) needs Ruby 3.2+.

| Dependency | Tested versions | Gem requirement |
| ----------- | ------------------- | --------------- |
| Ruby | 3.4.4, **4.0.9** | `>= 3.2` |
| Rails | **8.1.4.1** | `>= 7.1` |
| Phlex | **2.4.1** (phlex-rails **2.4.0**) | phlex-rails `>= 2.0` |
| RubyUI | **1.6.0** | 1.6.x components in the host app |
To run the suite against a specific Rails version locally:

```bash
export BUNDLE_GEMFILE=gemfiles/rails_8.1.gemfile
bundle install
(cd test/dummy && RAILS_ENV=test bin/rails db:schema:load)
bundle exec rake test
```

> **RubyUI's unreleased `main` is not supported yet.** It rewrites the `Combobox` family
> (`ComboboxPopover`, `ComboboxTrigger`, … are removed), which the admin's filter bar and
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 7.1.0"

# Shared development/test dependencies (dummy app, RubyUI, authorization adapters, docs viewer).
eval_gemfile "../Gemfile"
8 changes: 8 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 7.2.0"

# Shared development/test dependencies (dummy app, RubyUI, authorization adapters, docs viewer).
eval_gemfile "../Gemfile"
8 changes: 8 additions & 0 deletions gemfiles/rails_8.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 8.0.0"

# Shared development/test dependencies (dummy app, RubyUI, authorization adapters, docs viewer).
eval_gemfile "../Gemfile"
8 changes: 8 additions & 0 deletions gemfiles/rails_8.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 8.1.0"

# Shared development/test dependencies (dummy app, RubyUI, authorization adapters, docs viewer).
eval_gemfile "../Gemfile"
3 changes: 2 additions & 1 deletion test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

module Dummy
class Application < Rails::Application
config.load_defaults 7.2
# Never above 7.2 (what the suite was written against), but no higher than the running Rails.
config.load_defaults [Rails::VERSION::STRING.to_f, 7.2].min

config.eager_load = false
config.consider_all_requests_local = true
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.1].define(version: 2026_01_01_000008) do
ActiveRecord::Schema[7.1].define(version: 2026_01_01_000008) do
create_table "active_storage_attachments", force: :cascade do |t|
t.integer "blob_id", null: false
t.datetime "created_at", null: false
Expand Down
Loading