Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# current git branch
SOLARGRAPH_FORCE_VERSION=0.0.1.dev-$(git rev-parse --abbrev-ref HEAD | tr -d '\n' | tr -d '/' | tr -d '-'| tr -d '_')
export SOLARGRAPH_FORCE_VERSION
12 changes: 7 additions & 5 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ name: Linting
on:
workflow_dispatch: {}
pull_request:
branches: [ master ]
branches: ['*']
push:
branches:
- 'main'
- 'master'
tags:
- 'v*'

Expand All @@ -31,13 +31,15 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler: latest
bundler-cache: true
cache-version: 2025-06-06
cache-version: 2026-01-11

- name: Update to best available RBS
run: |
bundle update rbs # use latest available for this Ruby version
bundle update --pre rbs # use latest available for this Ruby version
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
bundle install

- name: Restore cache of gem annotations
id: dot-cache-restore
Expand Down
81 changes: 47 additions & 34 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
push:
branches: [master]
pull_request:
branches: [master]
branches: ['*']

permissions:
contents: read
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
ruby-version: 3.4 # keep same as typecheck.yml
bundler-cache: true
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -33,8 +33,10 @@ jobs:
run: |
echo 'gem "solargraph-rails"' > .Gemfile
echo 'gem "solargraph-rspec"' >> .Gemfile
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
bundle install
bundle update rbs
bundle update --pre rbs
- name: Configure to use plugins
run: |
bundle exec solargraph config
Expand All @@ -43,7 +45,7 @@ jobs:
- name: Install gem types
run: bundle exec rbs collection update
- name: Ensure typechecking still works
run: bundle exec solargraph typecheck --level typed
run: bundle exec solargraph typecheck --level strong
- name: Ensure specs still run
run: bundle exec rake spec
rails:
Expand All @@ -54,7 +56,9 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
ruby-version: 3.4 # keep same as typecheck.yml
# See https://github.com/castwide/solargraph/actions/runs/19000135777/job/54265647107?pr=1119
rubygems: latest
bundler-cache: false
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -63,16 +67,18 @@ jobs:
- name: Install gems
run: |
echo 'gem "solargraph-rails"' > .Gemfile
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
bundle install
bundle update rbs
bundle update --pre rbs
- name: Configure to use plugins
run: |
bundle exec solargraph config
yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml
- name: Install gem types
run: bundle exec rbs collection update
- name: Ensure typechecking still works
run: bundle exec solargraph typecheck --level typed
run: bundle exec solargraph typecheck --level strong
- name: Ensure specs still run
run: bundle exec rake spec
rspec:
Expand All @@ -83,7 +89,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
ruby-version: 3.4 # keep same as typecheck.yml
bundler-cache: false
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -92,16 +98,18 @@ jobs:
- name: Install gems
run: |
echo 'gem "solargraph-rspec"' >> .Gemfile
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
bundle install
bundle update rbs
bundle update --pre rbs
- name: Configure to use plugins
run: |
bundle exec solargraph config
yq -yi '.plugins += ["solargraph-rspec"]' .solargraph.yml
- name: Install gem types
run: bundle exec rbs collection update
- name: Ensure typechecking still works
run: bundle exec solargraph typecheck --level typed
run: bundle exec solargraph typecheck --level strong
- name: Ensure specs still run
run: bundle exec rake spec

Expand All @@ -118,45 +126,48 @@ jobs:
cd ..
# git clone https://github.com/lekemula/solargraph-rspec.git

# pending https://github.com/lekemula/solargraph-rspec/pull/30
# pending https://github.com/lekemula/solargraph-rspec/pull/31
git clone https://github.com/apiology/solargraph-rspec.git
cd solargraph-rspec
git checkout reset_closures
git checkout test_solargraph_prereleases
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
ruby-version: 3.4
rubygems: latest
bundler-cache: false
- name: Install gems
run: |
set -x
set -x

cd ../solargraph-rspec
echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
bundle config path ${{ env.BUNDLE_PATH }}
bundle install --jobs 4 --retry 3
bundle exec appraisal install
# @todo some kind of appraisal/bundle conflict?
# https://github.com/castwide/solargraph/actions/runs/19038710934/job/54369767122?pr=1116
# /home/runner/work/solargraph/solargraph-rspec/vendor/bundle/ruby/3.1.0/gems/bundler-2.6.9/lib/bundler/runtime.rb:317:in
# `check_for_activated_spec!': You have already activated date
# 3.5.0, but your Gemfile requires date 3.4.1. Prepending
# `bundle exec` to your command may solve
# this. (Gem::LoadError)
bundle exec appraisal update date
# 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
cd ../solargraph-rspec
echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
bundle config path ${{ env.BUNDLE_PATH }}
bundle install --jobs 4 --retry 3
bundle exec appraisal install
# @todo some kind of appraisal/bundle conflict?
# https://github.com/castwide/solargraph/actions/runs/19038710934/job/54369767122?pr=1116
# /home/runner/work/solargraph/solargraph-rspec/vendor/bundle/ruby/3.1.0/gems/bundler-2.6.9/lib/bundler/runtime.rb:317:in
# `check_for_activated_spec!': You have already activated date
# 3.5.0, but your Gemfile requires date 3.4.1. Prepending
# `bundle exec` to your command may solve
# this. (Gem::LoadError)
bundle exec appraisal update date
# 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: Configure .solargraph.yml
run: |
cd ../solargraph-rspec
cp .solargraph.yml.example .solargraph.yml
- name: Solargraph generate RSpec gems YARD and RBS pins
- name: Solargraph generate RSpec gems YARD pins
run: |
cd ../solargraph-rspec
bundle exec appraisal rbs collection update
# solargraph-rspec's specs don't pass a workspace, so it
# doesn't know where to look for the RBS collection - let's
# not load one so that the solargraph gems command below works

rspec_gems=$(bundle exec appraisal ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1)
bundle exec appraisal solargraph gems $rspec_gems
- name: Run specs
Expand All @@ -181,6 +192,8 @@ jobs:
# This job uses 3.2 due to a problem compiling sqlite3 in earlier versions
ruby-version: '3.2'
bundler-cache: false
# https://github.com/apiology/solargraph/actions/runs/19400815835/job/55508092473?pr=17
rubygems: latest
bundler: latest
env:
MATRIX_RAILS_VERSION: "7.0"
Expand All @@ -192,7 +205,7 @@ jobs:
cd ../solargraph-rails
echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile
bundle install
bundle update rbs
bundle update --pre rbs
RAILS_DIR="$(pwd)/spec/rails7"
export RAILS_DIR
cd ${RAILS_DIR}
Expand Down
67 changes: 44 additions & 23 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: ['*']

permissions:
contents: read
Expand All @@ -21,31 +21,56 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
rbs-version: ['3.6.1', '3.9.5', '4.0.0.dev.4']
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0', 'head']
rbs-version: ['3.6.1', '3.8.1', '3.9.5', '3.10.0', '4.0.1']
# Ruby 3.0 doesn't work with RBS 3.9.4 or 4.0.0.dev.4
exclude:
# only include the 3.0 variants we include later
- ruby-version: '3.0'
rbs-version: '3.9.5'
- ruby-version: '3.0'
rbs-version: '4.0.0.dev.4'
# Missing require in 'rbs collection update' - hopefully
# fixed in next RBS release
# only include the 3.1 variants we include later
- ruby-version: '3.1'
# only include the 3.2 variants we include later
- ruby-version: '3.2'
# only include the 3.3 variants we include later
- ruby-version: '3.3'
# only include the 3.4 variants we include later
- ruby-version: '3.4'
# only include the 4.0 variants we include later
- ruby-version: '4.0'
# Don't exclude 'head' - let's test all RBS versions we
# can there.
#
#
# Just exclude some odd-ball compatibility issues we can't
# work around:
#
# https://github.com/castwide/solargraph/actions/runs/20627923548/job/59241444380?pr=1102
- ruby-version: 'head'
rbs-version: '3.6.1'
- ruby-version: 'head'
rbs-version: '3.8.1'
include:
- ruby-version: '3.0'
rbs-version: '3.6.1'
- ruby-version: '3.1'
rbs-version: '3.6.1'
- ruby-version: '3.2'
rbs-version: '3.8.1'
- ruby-version: '3.3'
rbs-version: '3.9.5'
- ruby-version: '3.3'
rbs-version: '3.10.0'
- ruby-version: '3.4'
rbs-version: '4.0.0.dev.5'
- ruby-version: '4.0'
rbs-version: '4.0.0.dev.4'
rbs-version: '4.0.0.dev.5'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
# see https://github.com/castwide/solargraph/actions/runs/19391419903/job/55485410493?pr=1119
#
# match version in Gemfile.lock and use same version below
bundler: 2.5.23
bundler-cache: false
bundler-cache: true
- name: Set rbs version
run: echo "gem 'rbs', '${{ matrix.rbs-version }}'" >> .Gemfile
# /home/runner/.rubies/ruby-head/lib/ruby/gems/3.5.0+2/gems/rbs-3.9.4/lib/rbs.rb:11:
Expand All @@ -54,15 +79,11 @@ jobs:
# starting from Ruby 3.6.0
- name: Work around legacy rbs deprecation on ruby > 3.4
run: echo "gem 'tsort'" >> .Gemfile
- name: Install gems
- name: Update gems
run: |
bundle _2.5.23_ install
bundle update rbs # use latest available for this Ruby version
bundle list
bundle exec solargraph pin 'Bundler::Dsl#source'
- name: Update types
run: |
bundle exec rbs collection update
run: bundle exec rbs collection update
- name: Run tests
run: bundle exec rake spec
undercover:
Expand All @@ -77,9 +98,9 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: false
- name: Install gems
run: bundle install
bundler-cache: true
- name: Update types
run: bundle exec rbs collection update
- name: Run tests
run: bundle exec rake spec
- name: Check PR coverage
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: ['*']

permissions:
contents: read
Expand All @@ -31,8 +31,10 @@ jobs:
bundler-cache: false
- name: Install gems
run: |
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
bundle install
bundle update rbs # use latest available for this Ruby version
bundle update --pre rbs # use latest available for this Ruby version
- name: Install gem types
run: bundle exec rbs collection install
- name: Typecheck self
Expand Down
Loading
Loading