Skip to content
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
35 changes: 18 additions & 17 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,46 @@ jobs:
steps:
- name: Checkout solargraph-rspec
uses: actions/checkout@v4
with:
path: solargraph-rspec

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: false

# FIXME: Why caching for ruby 2.6 and 2.7 is not working after setting up appraisals?
- name: Cache Ruby gems
uses: actions/cache@v3
with:
path: solargraph-rspec/vendor/bundle
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('solargraph-rspec/solargraph-rspec.gemspec') }}
path: vendor/bundle
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('solargraph-rspec.gemspec') }}
restore-keys: |
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('solargraph-rspec/solargraph-rspec.gemspec') }}
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('solargraph-rspec.gemspec') }}

- name: Install dependencies
run: |
cd solargraph-rspec
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec appraisal install
bundle install --jobs 4 --retry 3 # we need this to install appraisal
bundle exec appraisal bundle config path ../vendor/bundle
bundle exec appraisal install --jobs 4 --retry 3
# For some reason on ruby 3.1 it defaults to an old version: 1.3.2
# https://github.com/lekemula/solargraph-rspec/actions/runs/17814581205/job/50645370316?pr=22
# We update manually to the latest
bundle exec appraisal update rspec-rails

- name: Run Rubocop
run: cd solargraph-rspec && bundle exec rubocop
# https://github.com/rubocop/rubocop/issues/10893#issuecomment-1952517060
run: bundle exec rubocop --restart-server

- name: Set up yardocs
# yard gems caches the yardocs into <gem_path>/doc/.yardoc path, hence they should be cached by ruby gems cache
run: cd solargraph-rspec && bundle exec appraisal yard gems --verbose
- name: Configure .solargraph.yml
run: cp .solargraph.yml.example .solargraph.yml

- name: List all Yardoc constants and methods
- name: Solargraph cache RSpec plugins YARD and RBS
run: |
cd solargraph-rspec
bundle exec yard list
rspec_plugins=$(bundle exec appraisal bundle exec ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::TestHelpers.gem_names.join(" ")' 2>/dev/null | tail -n1)
bundle exec appraisal bundle exec solargraph gems --rebuild $rspec_plugins

- name: Run tests
run: cd solargraph-rspec && bundle exec appraisal rspec --format progress
run: bundle exec appraisal rspec --format progress

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand Down
7 changes: 3 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ plugins:
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- 'gemfiles/**/*' # these are autogenerated files
- 'tmp/**/*' # git ignored anyway

Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes
Exclude:
- "gemfiles/**/*"

Style/FrozenStringLiteralComment:
Enabled: true
Exclude:
- "gemfiles/**/*"

Style/StringLiteralsInInterpolation:
Enabled: true
Expand Down
26 changes: 26 additions & 0 deletions .solargraph.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
include:
- "**/*.rb"
exclude:
- "spec/solargraph/**/*"
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
reporters:
- typecheck:strict
- rubocop
- require_not_found
formatter:
rubocop:
cops: all
require_paths: []
plugins:
- solargraph-rspec
max_files: 20000
rspec:
let_methods:
- let_it_be
example_methods:
- my_example
1 change: 1 addition & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

appraise 'default' do
# default gems from Gemfile
gem 'net-imap', '~> 0.4.0' # https://github.com/lsegal/yard/issues/1629
end
3 changes: 3 additions & 0 deletions gemfiles/default.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ gem "debug"
gem "profile-viewer"
gem "pry-byebug"
gem "rake"
gem "rbs"
gem "rspec"
gem "rubocop"
gem "rubocop-yard"
gem "simplecov"
gem "simplecov-cobertura"
gem "net-imap", "~> 0.4.0"

group :third_party_plugin_tests do
gem "actionmailer"
Expand Down
Loading
Loading