Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows / CI: fixed & refactored #935

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 36 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,42 @@
name: CI

on:
- push
Alexander-Senko marked this conversation as resolved.
Show resolved Hide resolved
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
rspec:
runs-on: ubuntu-20.04
name: >-
rspec (${{ matrix.ruby }})
Comment on lines +15 to +16
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the name, but we need it to match with the required workflows.

Does anyone have an access to change them? Otherwise, we have to support outdated ones for ages 😕


runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
- '2.6'
- '2.5'
- '2.4'
- 3.3
- 3.2
- 3.1
rails:
- 6.1 # TODO: move to 7.2
Alexander-Senko marked this conversation as resolved.
Show resolved Hide resolved
include:
# Edge
- { ruby: 'head', rails: 'edge', allow-fail: true }
# Outdated
- { ruby: '3.0', rails: '6.1' } # TODO: move to 7.1
- { ruby: '2.7', rails: '6' } # RSpec AR Expectations support Rails 7.1 since Ruby 3.0
- { ruby: '2.6', rails: '6' }
- { ruby: '2.5', rails: '6' }
- { ruby: '2.4', rails: '5' }

env:
RAILS_VERSION: "${{ matrix.rails }}"

services:
mongodb:
Expand All @@ -31,13 +46,13 @@ jobs:
- 27017:27017

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
bundler-cache: true

- name: RSpec & publish code coverage
Expand All @@ -46,3 +61,11 @@ jobs:
CC_TEST_REPORTER_ID: b7ba588af2a540fa96c267b3655a2afe31ea29976dc25905a668dd28d5e88915
with:
coverageCommand: bin/rake
continue-on-error: ${{ matrix.allow-fail }}
id: test

- name: >-
Test ${{ steps.test.outcome }}
run: |
echo Ruby ${{ matrix.ruby }}
echo Rails ${{ matrix.rails }}
38 changes: 18 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ source "https://rubygems.org"

gemspec

gem 'puma'

platforms :ruby do
if RUBY_VERSION >= "2.5.0"
gem 'sqlite3', '~> 1.4'
Expand All @@ -15,32 +17,28 @@ platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
end

if RUBY_VERSION >= "2.6.0"
gem "turbo-rails"
gem "redis", "~> 4.0"
end
gem 'mongoid'

if RUBY_VERSION >= "2.5.0"
gem "rails", "~> 6.0"
gem 'webrick'
case rails_version = ENV['RAILS_VERSION']
when nil
gem 'rails'
when 'edge'
gem 'rails', github: 'rails/rails'
else
gem "rails", "~> 5.0"
gem 'rails', "~> #{rails_version}.0"
end

if RUBY_VERSION >= "2.7.0"
gem "mongoid", github: "mongodb/mongoid"
elsif RUBY_VERSION >= "2.6.0"
gem "mongoid", "~> 8.1"
else
gem "mongoid", "~> 7.2"
end

if RUBY_VERSION >= "3.1.0"
gem "net-imap"
gem "net-pop"
gem "net-smtp"
case RUBY_VERSION
when '2.6'...'3.0'
gem "turbo-rails", "<= 2.0.7"
gem "redis", "~> 4.0"
when '3.0'...'4'
gem 'turbo-rails'
gem 'redis', '~> 4.0'
end

if RUBY_VERSION < "2.5.0"
gem 'rspec-activerecord-expectations', '~> 1.2.0'
gem 'simplecov', '0.17.1'
gem "loofah", "< 2.21.0" # Workaround for `uninitialized constant Nokogiri::HTML4`
end
4 changes: 2 additions & 2 deletions draper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Gem::Specification.new do |s|
s.add_development_dependency 'ammeter'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'rspec-activerecord-expectations', '~> 1.2.0'
s.add_development_dependency 'rspec-activerecord-expectations'
s.add_development_dependency 'minitest-rails'
s.add_development_dependency 'capybara'
s.add_development_dependency 'active_model_serializers', '>= 0.10'
s.add_development_dependency 'rubocop'
s.add_development_dependency 'simplecov', '0.17.1'
s.add_development_dependency 'simplecov'
end
Loading