Skip to content

Commit a9f36e3

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

File tree

3 files changed

+129
-7
lines changed

3 files changed

+129
-7
lines changed

.github/workflows/tests.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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+
- ruby: "2.7"
58+
rails: edge
59+
60+
- ruby: "3.0"
61+
rails: ~> 6.0.0
62+
- ruby: "3.0"
63+
rails: ~> 6.1.0
64+
- ruby: "3.0"
65+
rails: ~> 7.0.0
66+
- ruby: "3.0"
67+
rails: ~> 7.1.0
68+
- ruby: "3.0"
69+
rails: edge
70+
71+
- ruby: "3.1"
72+
rails: ~> 6.0.0
73+
- ruby: "3.1"
74+
rails: ~> 6.1.0
75+
- ruby: "3.1"
76+
rails: ~> 7.0.0
77+
- ruby: "3.1"
78+
rails: ~> 7.1.0
79+
- ruby: "3.1"
80+
rails: edge
81+
82+
- ruby: "3.2"
83+
rails: ~> 6.0.0
84+
- ruby: "3.2"
85+
rails: ~> 6.1.0
86+
- ruby: "3.2"
87+
rails: ~> 7.0.0
88+
- ruby: "3.2"
89+
rails: ~> 7.1.0
90+
- ruby: "3.2"
91+
rails: edge
92+
93+
- ruby: head
94+
rails: ~> 6.0.0
95+
- ruby: head
96+
rails: ~> 6.1.0
97+
- ruby: head
98+
rails: ~> 7.0.0
99+
- ruby: head
100+
rails: ~> 7.1.0
101+
- ruby: head
102+
rails: edge
103+
104+
env:
105+
RAILS_VERSION: ${{ matrix.rails }}
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
- uses: ruby/setup-ruby@v1
110+
with:
111+
ruby-version: ${{ matrix.ruby }}
112+
bundler: ${{ matrix.bundler }}
113+
- name: Run bundle update
114+
run: bundle update
115+
- name: Run tests
116+
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Gem::Specification.new do |spec|
3232

3333
spec.add_development_dependency "bundler"
3434
spec.add_development_dependency "minitest"
35-
spec.add_development_dependency "rails"
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)