forked from iftheshoefritz/solargraph-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iftheshoefritz#51 from iftheshoefritz/split_rails_…
…jobs Split CI jobs for more granular control
- Loading branch information
Showing
2 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |