diff --git a/.github/workflows/TestPR.yml b/.github/workflows/TestPR.yml
index 93a5970a6..e09b92770 100644
--- a/.github/workflows/TestPR.yml
+++ b/.github/workflows/TestPR.yml
@@ -26,11 +26,25 @@ jobs:
steps:
- uses: actions/checkout@v3
+ - name: Clear Ruby cache
+ run: |
+ rm -rf ~/.ruby-version
+ rm -rf ~/.rbenv
+ rm -rf ~/.rvm
+ rm -rf /usr/local/rvm
+ rm -rf /opt/ruby
+
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: 3.2.7
- bundler-cache: true
+ ruby-version: 3.4.5
+ bundler-cache: false
+
+ - name: Check Ruby Version
+ run: |
+ ruby -v
+ which ruby
+ gem env
- name: Setup Node.js
uses: actions/setup-node@v3
@@ -45,7 +59,10 @@ jobs:
run: |
gem update --system
gem install bundler:2.4.7
- bundle install
+ bundle config set --local deployment 'false'
+ bundle config set --local without ''
+ bundle config set --local force_ruby_platform true
+ bundle install --verbose
- name: Setup database
run: |
bundle exec rails db:create RAILS_ENV=test
diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml
index 728ae334a..8f1fb8f59 100644
--- a/.github/workflows/danger.yml
+++ b/.github/workflows/danger.yml
@@ -12,15 +12,36 @@ jobs:
with:
fetch-depth: 0
+ - name: Clear Ruby cache
+ run: |
+ rm -rf ~/.ruby-version
+ rm -rf ~/.rbenv
+ rm -rf ~/.rvm
+ rm -rf /usr/local/rvm
+ rm -rf /opt/ruby
+
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: '3.2.7'
+ ruby-version: '3.4.5'
+ bundler-cache: false
+
+ - name: Check Ruby Version
+ run: |
+ ruby -v
+ which ruby
+ gem env
- name: Install dependencies
- run: bundle install
+ run: |
+ gem update --system
+ gem install bundler:2.4.7
+ bundle config set --local deployment 'false'
+ bundle config set --local without ''
+ bundle config set --local force_ruby_platform true
+ bundle install --verbose
- name: Run Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: bundle exec danger --verbose
\ No newline at end of file
+ run: bundle exec danger --verbose
diff --git a/.github/workflows/danger_target.yml b/.github/workflows/danger_target.yml
index 00da8ffb8..f12326bc7 100644
--- a/.github/workflows/danger_target.yml
+++ b/.github/workflows/danger_target.yml
@@ -2,26 +2,40 @@ name: Danger
on:
pull_request_target:
types: [opened, synchronize, reopened]
+
jobs:
danger:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
+ - name: Remove .ruby-version if exists
+ run: |
+ if [ -f .ruby-version ]; then
+ echo "Removing .ruby-version file"
+ rm .ruby-version
+ fi
+
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: '3.2.7'
-
- - name: Install dependencies
- run: bundle install
+ ruby-version: '3.4.5'
+ bundler-cache: true
+ - name: Verify Ruby Version
+ run: |
+ echo "Ruby version:"
+ ruby -v
+ echo "Ruby path:"
+ which ruby
+ echo "Gem environment:"
+ gem env
- name: Run Danger
env:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 15843d3f9..b5c6344ed 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -27,11 +27,25 @@ jobs:
steps:
- uses: actions/checkout@v3
+ - name: Clear Ruby cache
+ run: |
+ rm -rf ~/.ruby-version
+ rm -rf ~/.rbenv
+ rm -rf ~/.rvm
+ rm -rf /usr/local/rvm
+ rm -rf /opt/ruby
+
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: 3.2.7
- bundler-cache: true
+ ruby-version: 3.4.5
+ bundler-cache: false
+
+ - name: Check Ruby Version
+ run: |
+ ruby -v
+ which ruby
+ gem env
- name: Setup Node.js
uses: actions/setup-node@v3
@@ -47,18 +61,19 @@ jobs:
run: |
gem update --system
gem install bundler:2.4.7
- bundle install
+ bundle config set --local deployment 'false'
+ bundle config set --local without ''
+ bundle config set --local force_ruby_platform true
+ bundle install --verbose
- name: Setup database
run: |
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:schema:load RAILS_ENV=test
- - name: Set up code climate test-reporter
+ - name: Set up code coverage
run: |
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
+ echo "SimpleCov coverage reporting is configured in spec_helper.rb"
- name: Run model tests
run: bundle exec rspec spec/models
@@ -66,14 +81,66 @@ jobs:
- name: Run controller tests
run: bundle exec rspec spec/requests/
- - name: Format code coverage report
- run: ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.models.json" --debug
+ - name: Generate coverage report
+ run: |
+ echo "Coverage report generated in coverage/index.html"
+ ls -la coverage/ || echo "No coverage directory found"
+ if [ -f coverage/index.html ]; then
+ echo "✅ Coverage report generated successfully"
+ echo "📊 Coverage percentage:"
+ grep -o '[0-9]\+\.[0-9]\+%' coverage/index.html | head -1 || echo "Coverage percentage not found"
+ else
+ echo "❌ Coverage report not generated"
+ fi
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: code-coverage-artifacts
path: coverage/
+
+ - name: Comment coverage on PR
+ if: github.event_name == 'pull_request'
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const fs = require('fs');
+ const path = require('path');
+
+ try {
+ // Read coverage data
+ const coveragePath = 'coverage/coverage.json';
+ if (fs.existsSync(coveragePath)) {
+ const coverage = JSON.parse(fs.readFileSync(coveragePath, 'utf8'));
+ const percentage = coverage.metrics.covered_percent.toFixed(2);
+
+ const comment = `## 📊 Code Coverage Report
+
+ **Coverage: ${percentage}%**
+
+ - **Lines covered:** ${coverage.metrics.covered_lines}/${coverage.metrics.total_lines}
+ - **Branches covered:** ${coverage.metrics.covered_branches}/${coverage.metrics.total_branches}
+
+ 📈 Coverage report generated with SimpleCov and Ruby 3.4.5
+
+
+ View detailed coverage report
+
+ Coverage artifacts are available in the workflow run.
+ `;
+
+ github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: comment
+ });
+ } else {
+ console.log('Coverage file not found');
+ }
+ } catch (error) {
+ console.log('Error creating coverage comment:', error.message);
+ }
publish_code_coverage:
@@ -91,10 +158,9 @@ jobs:
- name: Upload code-coverage report to code-climate
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json
- ./cc-test-reporter after-build -t simplecov -r ${{ secrets.CC_TEST_REPORTER_ID }}
+ gem install codeclimate-test-reporter
+ cc-test-reporter sum-coverage coverage/codeclimate.*.json
+ cc-test-reporter after-build -t simplecov -r ${{ secrets.CC_TEST_REPORTER_ID }}
docker:
needs: test
diff --git a/.ruby-version b/.ruby-version
index aa6fd8a3d..df9407bbb 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-ruby-3.2.7
\ No newline at end of file
+ruby-3.4.5
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index e89a49ee8..ff57d5dd5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM ruby:3.2.7
+FROM ruby:3.4.5
LABEL maintainer="Ankur Mundra "
# Install dependencies
diff --git a/Gemfile b/Gemfile
index 4f4ae9434..d3d733e54 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,14 +1,32 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
-ruby '3.2.7'
+ruby '3.4.5'
-gem 'mysql2', '~> 0.5.5'
-gem 'puma', '~> 5.0'
+gem 'mysql2', '~> 0.5.7'
+gem 'sqlite3', '~> 1.4' # Alternative for development
+gem 'puma', '~> 6.0'
gem 'rails', '~> 8.0', '>= 8.0.1'
+gem 'mini_portile2', '~> 2.8' # Helps with native gem compilation
+gem 'observer' # Required for Ruby 3.4.5 compatibility with Rails 8.0
+gem 'mutex_m' # Required for Ruby 3.4.5 compatibility
+gem 'faraday-retry' # Required for Faraday v2.0+ compatibility
+gem 'bigdecimal' # Required for Ruby 3.4.5 compatibility
+gem 'csv' # Required for Ruby 3.4.5 compatibility
+gem 'date' # Required for Ruby 3.4.5 compatibility
+gem 'delegate' # Required for Ruby 3.4.5 compatibility
+gem 'forwardable' # Required for Ruby 3.4.5 compatibility
+gem 'logger' # Required for Ruby 3.4.5 compatibility
+gem 'monitor' # Required for Ruby 3.4.5 compatibility
+gem 'ostruct' # Required for Ruby 3.4.5 compatibility
+gem 'set' # Required for Ruby 3.4.5 compatibility
+gem 'singleton' # Required for Ruby 3.4.5 compatibility
+gem 'timeout' # Required for Ruby 3.4.5 compatibility
+gem 'uri' # Required for Ruby 3.4.5 compatibility
gem 'rswag-api'
gem 'rswag-ui'
gem 'active_model_serializers', '~> 0.10.0'
+gem 'psych', '~> 5.2' # Ensure compatible psych version for Ruby 3.4.5
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
diff --git a/Gemfile.lock b/Gemfile.lock
index a901506e0..b2c2889ee 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -209,13 +209,13 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
- nokogiri (1.15.2-aarch64-linux)
+ nokogiri (1.18.10-aarch64-linux-gnu)
racc (~> 1.4)
- nokogiri (1.15.2-arm64-darwin)
+ nokogiri (1.18.10-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.15.2-x64-mingw-ucrt)
+ nokogiri (1.18.10-x64-mingw-ucrt)
racc (~> 1.4)
- nokogiri (1.15.2-x86_64-linux)
+ nokogiri (1.18.10-x86_64-linux-gnu)
racc (~> 1.4)
octokit (10.0.0)
faraday (>= 1, < 3)
@@ -233,7 +233,7 @@ GEM
date
stringio
public_suffix (5.0.3)
- puma (5.6.6)
+ puma (6.6.1)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
@@ -390,7 +390,7 @@ DEPENDENCIES
jwt (~> 2.7, >= 2.7.1)
lingua
mysql2 (~> 0.5.5)
- puma (~> 5.0)
+ puma (~> 6.0)
rack-cors
rails (~> 8.0, >= 8.0.1)
rspec-rails
@@ -405,7 +405,7 @@ DEPENDENCIES
tzinfo-data
RUBY VERSION
- ruby 3.2.7p253
+ ruby 3.4.5p0
BUNDLED WITH
2.4.14
diff --git a/README.md b/README.md
index 035aee277..2c94a747a 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ application up and running.
Things you may want to cover:
-* Ruby version - 3.2.1
+* Ruby version - 3.4.5
## Development Environment
diff --git a/docker-compose.yml b/docker-compose.yml
index 85edfda55..f22dc27ef 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,5 +1,3 @@
-version: '3.1'
-
services:
app:
build: .