Skip to content

Commit

Permalink
install rvm on GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Aug 27, 2024
1 parent 9d46190 commit 4beebcc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion macos/runtime_setup_stages/install_gems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ ROOTDIR=$(dirname "$0")
ROOTDIR=$(cd "$ROOTDIR/../.." && pwd)
source "$ROOTDIR/shared/lib/library.sh"

RUBY_VERSIONS=($(cat "$ROOTDIR/shared/definitions/ruby_versions"))
read -ra RUBY_VERSIONS < "$ROOTDIR/shared/definitions/ruby_versions"
LAST_RUBY_VERSION=${RUBY_VERSIONS[${#RUBY_VERSIONS[@]} - 1]}

if [[ -e /usr/local/rvm/bin/rvm-exec ]]; then
RVM_EXEC=/usr/local/rvm/bin/rvm-exec
elif [[ -e $HOME/.rvm/bin/rvm-exec ]]; then
RVM_EXEC=$HOME/.rvm/bin/rvm-exec
elif [ "${GITHUB_ACTIONS:-false}" = 'true' ]; then
\curl -sSL https://get.rvm.io | bash
RVM_EXEC=$HOME/.rvm/bin/rvm-exec
else
echo "*** ERROR: you must have RVM installed"
exit 1
Expand All @@ -27,6 +30,8 @@ ALL_RUBIES_OK=true
for RUBY_VERSION in "${RUBY_VERSIONS[@]}"; do
if run_ruby "$RUBY_VERSION" ruby -v &>/dev/null; then
echo "Ruby $RUBY_VERSION: ok"
elif [ "${GITHUB_ACTIONS:-false}" = 'true' ]; then
rvm install "ruby-$RUBY_VERSION"
else
echo "Ruby $RUBY_VERSION: NOT INSTALLED! Please install it!"
ALL_RUBIES_OK=false
Expand Down

0 comments on commit 4beebcc

Please sign in to comment.