Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
santib committed Jun 6, 2022
1 parent 74ab8ba commit 5d2552a
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 12 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,34 @@ on:
push:
branches:
- main

pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.1.2'

gemfile: [rails_5_2.gemfile, rails_6_0.gemfile, rails_6_1.gemfile, rails_7_0.gemfile, rails_main.gemfile]
ruby_version: [2.5, 2.6, 2.7, 3.0]
exclude:
- gemfile: rails_main.gemfile
ruby_version: 2.5
- gemfile: rails_main.gemfile
ruby_version: 2.6
- gemfile: rails_7_0.gemfile
ruby_version: 2.5
- gemfile: rails_7_0.gemfile
ruby_version: 2.6
env:
BUNDLE_GEMFILE: spec/gemfiles/${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- name: Run test
run: |
bundle exec rubocop
bundle exec rspec
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@

# rspec failure tracking
.rspec_status

Gemfile.lock
6 changes: 2 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
AllCops:
TargetRubyVersion: 2.5.0
NewCops: enable
SuggestExtensions: false

Metrics/MethodLength:
Enabled: true
Expand All @@ -17,10 +19,6 @@ Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Lint/ConstantDefinitionInBlock:
Enabled: false

Expand Down
1 change: 1 addition & 0 deletions ar2dto.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
spec.metadata["source_code_uri"] = "https://github.com/santib/ar2dto"
spec.metadata["bug_tracker_uri"] = "https://github.com/santib/ar2dto/issues"
spec.metadata["changelog_uri"] = "https://github.com/santib/ar2dto/releases"
spec.metadata["rubygems_mfa_required"] = "true"

spec.files = Dir["LICENSE.txt", "README.md", "lib/**/*"]
spec.require_paths = ["lib"]
Expand Down
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: "../.."

gem "rails", "~> 5.2.0"
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: "../.."

gem "rails", "~> 6.0.0"
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: "../.."

gem "rails", "~> 6.1.0"
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: "../.."

gem "rails", "~> 7.0.0"
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_main.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: "../.."

gem "rails", git: "https://github.com/rails/rails", branch: "main"

0 comments on commit 5d2552a

Please sign in to comment.