Skip to content

Merge YARD macro support #3075

Merge YARD macro support

Merge YARD macro support #3075

Workflow file for this run

---
name: Plugin
# To debug locally:
# npm install -g act
# cd /Users/broz/src/solargraph/ && act pull_request -j run_solargraph_rails_specs # e.g.
on:
push:
branches: [master]
pull_request:
branches: ['*']
permissions:
contents: read
jobs:
regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 4.0 # keep same as typecheck.yml
bundler-cache: true
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: yq
version: 1.0
- name: Install gems
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
- name: Configure to use plugins
run: |
bundle exec solargraph config
yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml
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 strong
# @todo Temporary, expect to revert in 0.60
continue-on-error: true
- name: Ensure specs still run
run: bundle exec rake spec
rails:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
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:
packages: yq
version: 1.0
- 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 --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 strong
# @todo Temporary, expect to revert in 0.60
continue-on-error: true
- name: Ensure specs still run
run: bundle exec rake spec
rspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4 # keep same as typecheck.yml
bundler-cache: false
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: yq
version: 1.0
- 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 --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 strong
# @todo Temporary, expect to revert in 0.60
continue-on-error: true
- name: Ensure specs still run
run: bundle exec rake spec
run_solargraph_rspec_specs:
# check out solargraph-rspec as well as this project, and point the former to use the latter as a local gem
runs-on: ubuntu-latest
env:
SOLARGRAPH_CACHE: ${{ github.workspace }}/../solargraph-rspec/vendor/solargraph/cache
BUNDLE_PATH: ${{ github.workspace }}/../solargraph-rspec/vendor/bundle
steps:
- uses: actions/checkout@v3
- name: clone https://github.com/lekemula/solargraph-rspec/
run: |
cd ..
# git clone https://github.com/lekemula/solargraph-rspec.git
# pending https://github.com/lekemula/solargraph-rspec/pull/31
git clone https://github.com/apiology/solargraph-rspec.git
cd solargraph-rspec
git checkout test_solargraph_prereleases
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
rubygems: latest
bundler-cache: false
- name: Install gems
run: |
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
- name: Configure .solargraph.yml
run: |
cd ../solargraph-rspec
cp .solargraph.yml.example .solargraph.yml
- name: Solargraph generate RSpec gems YARD pins
run: |
cd ../solargraph-rspec
# 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
run: |
cd ../solargraph-rspec
bundle exec appraisal rspec --format progress
run_solargraph_rails_specs:
# check out solargraph-rails as well as this project, and point the former to use the latter as a local gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: clone solargraph-rails
run: |
cd ..
git clone https://github.com/iftheshoefritz/solargraph-rails.git
cd solargraph-rails
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
# solargraph-rails supports Ruby 3.0+
# 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"
- name: Install gems
run: |
set -x
BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle"
export BUNDLE_PATH
cd ../solargraph-rails
echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile
bundle install
bundle update --pre rbs
RAILS_DIR="$(pwd)/spec/rails7"
export RAILS_DIR
cd ${RAILS_DIR}
bundle install
bundle exec --gemfile ../../Gemfile rbs --version
bundle exec --gemfile ../../Gemfile rbs collection install
cd ../../
# bundle exec rbs collection init
# bundle exec rbs collection install
env:
MATRIX_RAILS_VERSION: "7.0"
MATRIX_RAILS_MAJOR_VERSION: '7'
- name: Run specs
run: |
BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle"
export BUNDLE_PATH
cd ../solargraph-rails
bundle exec solargraph --version
bundle info solargraph
bundle info rbs
bundle info yard
ALLOW_IMPROVEMENTS=true bundle exec rake spec
env:
MATRIX_RAILS_VERSION: "7.0"
# @todo Temporary, expect to revert in 0.60
continue-on-error: true