Skip to content

Commit 17fc82d

Browse files
committed
Implement CI Matrix
1 parent 48f4b4e commit 17fc82d

File tree

11 files changed

+110
-6
lines changed

11 files changed

+110
-6
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
name: Lint
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 5
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
17+
- name: Set up Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
bundler-cache: true
21+
rubygems: latest
22+
23+
- name: Run RuboCop
24+
run: bundle exec rubocop --fail-level warning --display-only-fail-level-offenses --format github
25+
26+
test:
27+
name: Test - ${{ matrix.gemfile }} - Ruby ${{ matrix.ruby }}
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 10
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
ruby: ["3.0", 3.1, 3.2, 3.3, 3.4]
34+
gemfile:
35+
[
36+
activesupport-7.1,
37+
activesupport-7.2,
38+
activesupport-8.0,
39+
activesupport-8.1,
40+
]
41+
exclude:
42+
# Rails 7.2 is >= 3.1
43+
- ruby: "3.0"
44+
gemfile: activesupport-7.2
45+
# Rails 8.0 is >= 3.2
46+
- ruby: "3.0"
47+
gemfile: activesupport-8.0
48+
- ruby: 3.1
49+
gemfile: activesupport-8.0
50+
# Rails 8.1 is >= 3.2
51+
- ruby: "3.0"
52+
gemfile: activesupport-8.1
53+
- ruby: 3.1
54+
gemfile: activesupport-8.1
55+
56+
env:
57+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
58+
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v5
62+
- name: Update .ruby-version with matrix value
63+
run: echo "${{ matrix.ruby }}" >| .ruby-version
64+
# Dependencies
65+
- name: Set up Ruby and bundle install
66+
uses: ruby/setup-ruby@v1
67+
with:
68+
bundler-cache: true
69+
rubygems: latest
70+
71+
# Test
72+
- name: Run Unit tests
73+
run: bundle exec rspec
74+
75+
- name: Publish Test Results
76+
uses: mikepenz/action-junit-report@v4
77+
if: always()
78+
with:
79+
check_name: Test Results
80+
report_paths: tmp/rspec.xml
81+
detailed_summary: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010

1111
# rspec failure tracking
1212
.rspec_status
13+
marsh_grass*.gem

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
--format documentation
2+
--format RspecJunitFormatter --out tmp/rspec.xml
23
--color

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.7

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
44

55
# Specify your gem's dependencies in marsh_grass.gemspec
66
gemspec
7+
8+
group :development, :test do
9+
gem 'rubocop'
10+
gem 'rspec_junit_formatter'
11+
end

gemfiles/activesupport-7.1.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem 'activesupport', '~> 7.1.0'
4+
5+
eval_gemfile "../Gemfile"

gemfiles/activesupport-7.2.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem 'activesupport', '~> 7.2.0'
4+
5+
eval_gemfile "../Gemfile"

gemfiles/activesupport-8.0.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem 'activesupport', '~> 8.0.0'
4+
5+
eval_gemfile "../Gemfile"

gemfiles/activesupport-8.1.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem 'activesupport', '~> 8.1.0'
4+
5+
eval_gemfile "../Gemfile"

0 commit comments

Comments
 (0)