Skip to content

Commit 4beebcc

Browse files
committed
install rvm on GHA
1 parent 9d46190 commit 4beebcc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

macos/runtime_setup_stages/install_gems.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ ROOTDIR=$(dirname "$0")
44
ROOTDIR=$(cd "$ROOTDIR/../.." && pwd)
55
source "$ROOTDIR/shared/lib/library.sh"
66

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

1010
if [[ -e /usr/local/rvm/bin/rvm-exec ]]; then
1111
RVM_EXEC=/usr/local/rvm/bin/rvm-exec
1212
elif [[ -e $HOME/.rvm/bin/rvm-exec ]]; then
1313
RVM_EXEC=$HOME/.rvm/bin/rvm-exec
14+
elif [ "${GITHUB_ACTIONS:-false}" = 'true' ]; then
15+
\curl -sSL https://get.rvm.io | bash
16+
RVM_EXEC=$HOME/.rvm/bin/rvm-exec
1417
else
1518
echo "*** ERROR: you must have RVM installed"
1619
exit 1
@@ -27,6 +30,8 @@ ALL_RUBIES_OK=true
2730
for RUBY_VERSION in "${RUBY_VERSIONS[@]}"; do
2831
if run_ruby "$RUBY_VERSION" ruby -v &>/dev/null; then
2932
echo "Ruby $RUBY_VERSION: ok"
33+
elif [ "${GITHUB_ACTIONS:-false}" = 'true' ]; then
34+
rvm install "ruby-$RUBY_VERSION"
3035
else
3136
echo "Ruby $RUBY_VERSION: NOT INSTALLED! Please install it!"
3237
ALL_RUBIES_OK=false

0 commit comments

Comments
 (0)