Skip to content

Commit cbffc38

Browse files
committed
Github workflow test matrix
1 parent 48958bc commit cbffc38

19 files changed

+94
-243
lines changed

.github/workflows/acl9.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7+
8+
name: Acl9
9+
10+
on:
11+
push:
12+
branches: [ "master" ]
13+
pull_request:
14+
branches: [ "master" ]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
rails-version: [ '7.0', '7.1', '7.2', '8.0', head ]
26+
ruby-version: ['3.1', '3.2', '3.3', '3.4']
27+
exclude:
28+
- rails-version: '8.0'
29+
ruby-version: '3.1'
30+
- rails-version: head
31+
ruby-version: '3.1'
32+
33+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
34+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Set up Ruby
39+
uses: ruby/setup-ruby@v1
40+
with:
41+
ruby-version: ${{ matrix.ruby-version }}
42+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
43+
- name: Run tests
44+
run: bundle exec rake

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222

2323
/acl9-*.gem
2424
/gemfiles/*.lock
25+
/Gemfile.lock

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.2
1+
3.1.7

.travis.yml

-40
This file was deleted.

Appraisals

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
appraise "rails-5.0" do
2-
gem 'rails', '~> 5.0.0'
3-
end
4-
5-
appraise "rails-5.1" do
6-
gem 'rails', '~> 5.1.0'
1+
appraise "rails-7.0" do
2+
gem 'rails', '~> 7.0.0'
73
end
84

9-
appraise "rails-5.2" do
10-
gem 'rails', '~> 5.2.0'
5+
appraise "rails-7.1" do
6+
gem 'rails', '~> 7.1.0'
117
end
128

13-
appraise "rails-6.0" do
14-
gem 'rails', '~> 6.0.0'
9+
appraise "rails-7.2" do
10+
gem 'rails', '~> 7.2.0'
1511
end
1612

17-
appraise "rails-6.1" do
18-
gem 'rails', '~> 6.1.0'
13+
appraise "rails-8.0" do
14+
gem 'rails', '~> 8.0.0'
1915
end
2016

21-
appraise "rails-7.0" do
22-
gem 'rails', '~> 7.0.0'
17+
appraise "rails-head" do
18+
gem "rails", github: "rails"
2319
end

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ gemspec
55

66
gem 'appraisal'
77
gem 'byebug'
8+
gem 'sqlite3'

Gemfile.lock

-152
This file was deleted.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# acl9
22

3-
[![Travis-CI](https://travis-ci.org/be9/acl9.svg?branch=master)](https://travis-ci.org/be9/acl9)
3+
![Workflow Status](https://github.com/be9/acl9/actions/workflows/acl9.yml/badge.svg)
44

55
Acl9 is a role-based authorization system that provides a concise DSL for
66
securing your Rails application.
@@ -19,7 +19,7 @@ Acl9 is [Semantically Versioned](http://semver.org/), so just add this to your
1919
gem 'acl9', '~> 3.2'
2020
```
2121

22-
You will need Ruby > 2.0
22+
We're only testing with Ruby >= 3.1 so YMMV for less than that
2323

2424
### Rails 4 - stick with 2.x
2525

acl9.gemspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ Gem::Specification.new do |s|
2020

2121
s.rdoc_options = ["--charset=UTF-8"]
2222

23-
s.add_dependency "rails", '>= 5.0', '< 8.0'
23+
s.add_dependency "rails", '>= 5.0'
2424

2525
s.add_development_dependency "yard"
26-
s.add_development_dependency 'sqlite3'
2726
end

bin/rails

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
#
35
# This file was generated by Bundler.
46
#
57
# The application 'rails' is installed as part of a gem, and
68
# this file is here to facilitate running it.
79
#
810

9-
require 'pathname'
10-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
1223

13-
require 'rubygems'
14-
require 'bundler/setup'
24+
require "rubygems"
25+
require "bundler/setup"
1526

16-
load Gem.bin_path('railties', 'rails')
27+
load Gem.bin_path("railties", "rails")

gemfiles/.bundle/config

-2
This file was deleted.

gemfiles/rails_5.1.gemfile

-10
This file was deleted.

gemfiles/rails_7.0.gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "byebug"
7+
gem "drb"
8+
gem "mutex_m"
9+
gem "bigdecimal"
10+
gem "sqlite3", "~> 1.6"
711
gem "rails", "~> 7.0.0"
812

913
gemspec path: "../"

gemfiles/rails_6.1.gemfile renamed to gemfiles/rails_7.1.gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "byebug"
7-
gem "rails", "~> 6.1.0"
7+
gem "sqlite3"
8+
gem "rails", "~> 7.1.0"
89

910
gemspec path: "../"

gemfiles/rails_5.2.gemfile renamed to gemfiles/rails_7.2.gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "byebug"
7-
gem "rails", "~> 5.2.0"
7+
gem "sqlite3"
8+
gem "rails", "~> 7.2.0"
89

910
gemspec path: "../"

gemfiles/rails_6.0.gemfile renamed to gemfiles/rails_8.0.gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source "http://rubygems.org"
44

55
gem "appraisal"
66
gem "byebug"
7-
gem "rails", "~> 6.0.0"
7+
gem "sqlite3"
8+
gem "rails", "~> 8.0.0"
89

910
gemspec path: "../"

0 commit comments

Comments
 (0)