Skip to content

Commit

Permalink
fix: ci workflow fixed by removing old ruby versions (#23)
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
Waishnav authored Jul 7, 2024
1 parent 71ac9fd commit 25e218b
Show file tree
Hide file tree
Showing 24 changed files with 1,065 additions and 856 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.7', '3.0']
ruby: ['3.1', '3.2', '3.3']
gemfile:
- rails_5_2
- rails_6
- rails_6_1
- rails_master
exclude:
- ruby: '3.0'
gemfile: 'rails_5_2'
- rails_7
- rails_7_1
- rails_main
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
BUNDLE_PATH_RELATIVE_TO_CWD: true
Expand All @@ -33,12 +30,12 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler: default
bundler-cache: true
rubygems: latest
- name: StandardRb check
run: bundle exec standardrb
- name: Run tests
env:
DATABASE_URL: "sqlite3:noticed_test"
STRIPE_PRIVATE_KEY: ${{ secrets.STRIPE_PRIVATE_KEY }}
DATABASE_URL: "sqlite3:simple_discussion_test"
run: |
bin/rails db:test:prepare
bin/rails test
21 changes: 13 additions & 8 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
appraise "rails-5-2" do
gem "rails", "~> 5.2.0"
# frozen_string_literal: true

appraise "rails-6-1" do
gem "rails", "~> 6.1.0"
gem "sqlite3", "~> 1.7.2"
end

appraise "rails-6" do
gem "rails", "~> 6.0.0"
appraise "rails-7" do
gem "rails", "~> 7.0.0"
gem "sqlite3", "~> 1.7.2"
end

appraise "rails-6-1" do
gem "rails", "~> 6.1.0"
appraise "rails-7-1" do
gem "rails", "~> 7.1.0"
gem "sqlite3", "~> 1.7.2"
end

appraise "rails-master" do
appraise "rails-main" do
gem "rails", github: "rails/rails", branch: "main"
gem "devise", github: "ghiculescu/devise", branch: "patch-2"
gem "sqlite3", "~> 2.0"
end
14 changes: 10 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
# Specify your gem's dependencies in simple_discussion.gemspec
gemspec

gem "appraisal"
gem "standardrb"

# used for dummy rails app integration
gem "devise"
gem "puma"
gem "sqlite3"
gem "sprockets-rails"

# testing against sqlite3 db
gem "sqlite3", "~> 1.7"

# testing
gem "appraisal"
gem "standardrb"
gem "font-awesome-sass", "~> 5.13.1"
4 changes: 2 additions & 2 deletions app/helpers/simple_discussion/forum_threads_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SimpleDiscussion::ForumThreadsHelper
# Used for flagging links in the navbar as active
def forum_link_to(path, opts = {}, &block)
link_to path, class: forum_link_class(path, opts), &block
def forum_link_to(path, opts = {}, &)
link_to(path, class: forum_link_class(path, opts), &)
end

def forum_link_class(matches, opts = {})
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/simple_discussion/forum_post_notification_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def send_emails(forum_post)
end

def send_webhook(forum_post)
slack_webhook_url = Rails.application.secrets.simple_discussion_slack_url
slack_webhook_url = Rails.application.credentials.simple_discussion_slack_url
return if slack_webhook_url.blank?

forum_thread = forum_post.forum_thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def send_emails(forum_thread)
end

def send_webhook(forum_thread)
slack_webhook_url = Rails.application.secrets.simple_discussion_slack_url
slack_webhook_url = Rails.application.credentials.simple_discussion_slack_url
return if slack_webhook_url.blank?

forum_post = forum_thread.forum_posts.first
Expand Down
4 changes: 3 additions & 1 deletion bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

ENV['RAILS_ENV'] ||= 'test'

ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/pay/engine', __dir__)
ENGINE_PATH = File.expand_path('../lib/simple_discussion/engine', __dir__)
APP_PATH = File.expand_path('../test/dummy/config/application', __dir__)

# Set up gems listed in the Gemfile.
Expand Down
191 changes: 0 additions & 191 deletions gemfiles/rails_5_2.gemfile.lock

This file was deleted.

Loading

0 comments on commit 25e218b

Please sign in to comment.