Skip to content

Commit cc094bf

Browse files
committed
Add GitHub Workflow
1 parent 9fa4d35 commit cc094bf

File tree

3 files changed

+126
-8
lines changed

3 files changed

+126
-8
lines changed

.github/workflows/tests.yml

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
include:
11+
- ruby: "2.4"
12+
rails: ~> 4.2.0
13+
bundler: 1.17.3
14+
- ruby: "2.4"
15+
rails: ~> 5.0.0
16+
- ruby: "2.4"
17+
rails: ~> 5.1.0
18+
- ruby: "2.4"
19+
rails: ~> 5.2.0
20+
21+
- ruby: "2.5"
22+
rails: ~> 5.0.0
23+
- ruby: "2.5"
24+
rails: ~> 5.1.0
25+
- ruby: "2.5"
26+
rails: ~> 5.2.0
27+
- ruby: "2.5"
28+
rails: ~> 6.0.0
29+
- ruby: "2.5"
30+
rails: ~> 6.1.0
31+
32+
- ruby: "2.6"
33+
rails: ~> 5.0.0
34+
- ruby: "2.6"
35+
rails: ~> 5.1.0
36+
- ruby: "2.6"
37+
rails: ~> 5.2.0
38+
- ruby: "2.6"
39+
rails: ~> 6.0.0
40+
- ruby: "2.6"
41+
rails: ~> 6.1.0
42+
43+
- ruby: "2.7"
44+
rails: ~> 5.0.0
45+
- ruby: "2.7"
46+
rails: ~> 5.1.0
47+
- ruby: "2.7"
48+
rails: ~> 5.2.0
49+
- ruby: "2.7"
50+
rails: ~> 6.0.0
51+
- ruby: "2.7"
52+
rails: ~> 6.1.0
53+
- ruby: "2.7"
54+
rails: ~> 7.0.0
55+
- ruby: "2.7"
56+
rails: ~> 7.1.0
57+
58+
- ruby: "3.0"
59+
rails: ~> 6.0.0
60+
- ruby: "3.0"
61+
rails: ~> 6.1.0
62+
- ruby: "3.0"
63+
rails: ~> 7.0.0
64+
- ruby: "3.0"
65+
rails: ~> 7.1.0
66+
67+
- ruby: "3.1"
68+
rails: ~> 6.0.0
69+
- ruby: "3.1"
70+
rails: ~> 6.1.0
71+
- ruby: "3.1"
72+
rails: ~> 7.0.0
73+
- ruby: "3.1"
74+
rails: ~> 7.1.0
75+
- ruby: "3.1"
76+
rails: edge
77+
78+
- ruby: "3.2"
79+
rails: ~> 6.0.0
80+
- ruby: "3.2"
81+
rails: ~> 6.1.0
82+
- ruby: "3.2"
83+
rails: ~> 7.0.0
84+
- ruby: "3.2"
85+
rails: ~> 7.1.0
86+
- ruby: "3.2"
87+
rails: edge
88+
89+
- ruby: head
90+
rails: ~> 6.0.0
91+
- ruby: head
92+
rails: ~> 6.1.0
93+
- ruby: head
94+
rails: ~> 7.0.0
95+
- ruby: head
96+
rails: ~> 7.1.0
97+
- ruby: head
98+
rails: edge
99+
100+
env:
101+
RAILS_VERSION: ${{ matrix.rails }}
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/checkout@v4
105+
- uses: ruby/setup-ruby@v1
106+
with:
107+
ruby-version: ${{ matrix.ruby }}
108+
bundler: ${{ matrix.bundler }}
109+
- name: Run bundle update
110+
run: bundle update
111+
- name: Run tests
112+
run: bundle exec rake

Gemfile

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
source "https://rubygems.org"
22

3-
# rubocop:disable Bundler/DuplicatedGem
4-
if ENV["RAILS_VERSION"]
5-
gem "rails", ENV["RAILS_VERSION"]
6-
elsif ENV["RAILS_BRANCH"]
7-
gem "rails", git: "https://github.com/rails/rails.git", branch: ENV["RAILS_BRANCH"]
3+
if ENV["RAILS_VERSION"] == "edge"
4+
gem "rails", git: "https://github.com/rails/rails.git", branch: "main"
5+
end
6+
7+
# Lock loofah to old version for Ruby 2.4
8+
unless RUBY_VERSION > "2.5"
9+
gem "loofah", "~> 2.20.0"
810
end
9-
# rubocop:enable Bundler/DuplicatedGem
1011

1112
gemspec

omniauth-rails_csrf_protection.gemspec

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ Gem::Specification.new do |spec|
3131
spec.add_dependency "omniauth", "~> 2.0"
3232

3333
spec.add_development_dependency "bundler"
34-
spec.add_development_dependency "minitest"
35-
spec.add_development_dependency "rails"
34+
spec.add_development_dependency "minitest", "5.22.3"
35+
36+
# We set requirement for Edge Rails in the Gemfile
37+
unless ENV["RAILS_VERSION"] == "edge"
38+
spec.add_development_dependency "rails", ENV["RAILS_VERSION"]
39+
end
40+
3641
spec.add_development_dependency "rake"
3742
end

0 commit comments

Comments
 (0)