Skip to content

Commit 971113d

Browse files
committed
Add GitHub Actions CI matrix
Run the spec suite across a matrix of Ruby, Rails, and ActiveAdmin versions on every push and pull request. Matrix: - Ruby 3.2, 3.3, 3.4 - Rails 7.2.0, 8.0.0 - ActiveAdmin 3.4.0, 3.5.0 Wiring: - Gemfile now resolves the rails/activeadmin versions from the RAILS and AA environment variables (defaulting to 7.2.0 / 3.5.0 for local dev), which lets a single Gemfile drive every matrix cell. - spec/dummy/config/application.rb picks load_defaults dynamically based on the resolved Rails version so the dummy app boots cleanly under both 7.2 and 8.0. - Gemspec Ruby floor dropped from 3.3 to 3.2 to match the matrix. - Add a CI status badge to the README. Modeled on activeadmin-plugins/active_admin_sidebar's workflow.
1 parent ab182ef commit 971113d

5 files changed

Lines changed: 46 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
test:
12+
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / AA ${{ matrix.activeadmin }}
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
ruby: ['3.2', '3.3', '3.4']
18+
rails: ['7.2.0', '8.0.0']
19+
activeadmin: ['3.4.0', '3.5.0']
20+
env:
21+
RAILS: ${{ matrix.rails }}
22+
AA: ${{ matrix.activeadmin }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: ${{ matrix.ruby }}
28+
bundler-cache: true
29+
- name: Run tests
30+
run: bundle exec rspec spec

Gemfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ source "https://rubygems.org"
44

55
gemspec
66

7-
# Pin Rails for the dev/test environment. The gemspec allows >= 7.2 at
8-
# runtime, but the dummy app and specs are validated against 7.2.
9-
gem "rails", "~> 7.2.0"
10-
gem "activerecord", "~> 7.2.0"
7+
default_rails_version = "7.2.0"
8+
default_activeadmin_version = "3.5.0"
9+
10+
rails_version = ENV.fetch("RAILS", default_rails_version)
11+
activeadmin_version = ENV.fetch("AA", default_activeadmin_version)
12+
13+
gem "rails", "~> #{rails_version}"
14+
gem "activerecord", "~> #{rails_version}"
15+
gem "activeadmin", "~> #{activeadmin_version}"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# activeadmin-oidc
22

3+
[![CI](https://github.com/activeadmin-plugins/activeadmin-oidc/actions/workflows/ci.yml/badge.svg)](https://github.com/activeadmin-plugins/activeadmin-oidc/actions/workflows/ci.yml)
4+
35
OpenID Connect single sign-on for [ActiveAdmin](https://activeadmin.info/).
46

57
Plugs OIDC into ActiveAdmin's existing Devise stack: JIT user provisioning, an `on_login` hook for host-owned authorization, a login-button view override, and a one-shot install generator. The OIDC protocol layer (discovery, JWKS, token verification, PKCE, nonce, state) is delegated to [`omniauth_openid_connect`](https://github.com/omniauth/omniauth_openid_connect).

activeadmin-oidc.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
1616
spec.license = "MIT"
1717
spec.homepage = "https://github.com/fedoronchuk/activeadmin-oidc"
1818

19-
spec.required_ruby_version = ">= 3.3.0"
19+
spec.required_ruby_version = ">= 3.2.0"
2020

2121
spec.files = Dir[
2222
"lib/**/*",

spec/dummy/config/application.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323

2424
module Dummy
2525
class Application < Rails::Application
26-
config.load_defaults 7.2
26+
# Pick the nearest Rails defaults for the Rails version that's
27+
# currently resolved. The CI matrix exercises 7.2 and 8.0.
28+
rails_gem_version = Gem::Version.new(Rails.version)
29+
config.load_defaults(rails_gem_version >= Gem::Version.new("8.0") ? 8.0 : 7.2)
2730
config.eager_load = false
2831
config.root = File.expand_path("..", __dir__)
2932

0 commit comments

Comments
 (0)