Allow solargraph version to be overridden for dev/test purposes #1884
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| 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: [master] | |
| 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: '3.0' | |
| 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 | |
| bundle install | |
| bundle update rbs | |
| - 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 typed | |
| - 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.0' | |
| 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 | |
| bundle install | |
| bundle update 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 | |
| - 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.0' | |
| 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 | |
| bundle install | |
| bundle update 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 | |
| - 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 | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - name: clone https://github.com/lekemula/solargraph-rspec/ | |
| # run: | | |
| # cd .. | |
| # git clone https://github.com/lekemula/solargraph-rspec.git | |
| # cd solargraph-rspec | |
| # - name: Set up Ruby | |
| # uses: ruby/setup-ruby@v1 | |
| # with: | |
| # ruby-version: '3.0' | |
| # bundler-cache: false | |
| # - name: Install gems | |
| # run: | | |
| # cd ../solargraph-rspec | |
| # echo "gem 'solargraph', path: '../solargraph'" >> Gemfile | |
| # bundle install | |
| # - name: Run specs | |
| # run: | | |
| # cd ../solargraph-rspec | |
| # bundle exec rake spec | |
| 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+ | |
| ruby-version: '3.0' | |
| bundler-cache: false | |
| 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 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" |