From e03c4847b146f96d5d08abdf78e1b2ce58c13314 Mon Sep 17 00:00:00 2001 From: Fritz Meissner Date: Fri, 18 Nov 2022 12:00:43 +0000 Subject: [PATCH] Add solargraph version as a CI matrix variable --- .github/workflows/ruby.yml | 15 ++++++++++++--- ci.sh | 27 ++++++++++++++++++++------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 07c0e3a..754bcc6 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -20,7 +20,13 @@ jobs: matrix: ruby-version: - "2.7" - - "3.0" + #- "3.0" + solargraph-version: + - "0.44.3" + #- "0.45.0" + #- "0.46.0" + #- "0.47.2" + fail-fast: false steps: - uses: actions/checkout@v2 @@ -32,5 +38,8 @@ jobs: path: | /home/runner/.rvm /home/runner/.yardoc - - name: Prepare Ruby - run: /bin/bash ./ci.sh ${{ matrix.ruby-version }} + #/usr/local/rvm/ + #- name: Setup upterm session + # uses: lhotari/action-upterm@v1 + - name: Test + run: "/bin/bash ./ci.sh ${{ matrix.ruby-version }} ${{ matrix.solargraph-version}}" diff --git a/ci.sh b/ci.sh index cd063e3..75d0f6d 100755 --- a/ci.sh +++ b/ci.sh @@ -1,21 +1,34 @@ #!/bin/bash set -e +# when running in github actions: RVM_PATH=/home/runner/.rvm -ARGS=("$@") +# when running locally using act: +#RVM_PATH=/usr/local/rvm +MATRIX_RUBY_VERSION=$1 +MATRIX_SOLARGRAPH_VERSION=$2 if [[ ! -d $RVM_PATH ]]; then - curl -sSL https://get.rvm.io | bash + # this fetches the develop version; using -s stable should fetch the latest stable, but has a gpg error: + curl -sSL https://get.rvm.io | bash -s fi +# when running in github actions: source /home/runner/.rvm/scripts/rvm +# when running locally in Act container: +#source /usr/local/rvm/scripts/rvm -rvm install ruby $ARGS -rvm use $ARGS + +#rvm package install openssl # hack because ubuntu won't give us openSSL +rvm install ruby $MATRIX_RUBY_VERSION +rvm use $MATRIX_RUBY_VERSION gem install bundler -(cd spec/rails5; bundle install; yard gems) -(cd spec/rails6; bundle install; yard gems) -(cd spec/rails7; bundle install; yard gems) +echo "s/gem 'solargraph'/gem 'solargraph', '${MATRIX_SOLARGRAPH_VERSION}'/" > command.sed + +(cd spec/rails5; sed -i -f ../../command.sed Gemfile; cat Gemfile; bundle install; yard gems) +(cd spec/rails6; sed -i -f ../../command.sed Gemfile; cat Gemfile; bundle install; yard gems) +(cd spec/rails7; sed -i -f ../../command.sed Gemfile; cat Gemfile; bundle install; yard gems) bundle install + bundle exec rspec