-
Notifications
You must be signed in to change notification settings - Fork 30
/
ci.sh
executable file
·34 lines (26 loc) · 1.07 KB
/
ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e
# when running in github actions:
RVM_PATH=/home/runner/.rvm
# when running locally using act:
#RVM_PATH=/usr/local/rvm
MATRIX_RUBY_VERSION=$1
MATRIX_SOLARGRAPH_VERSION=$2
if [[ ! -d $RVM_PATH ]]; then
# 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 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
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