Skip to content

Commit

Permalink
setup ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Aug 19, 2024
1 parent 142ec5c commit ed295d2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
SUDO: ${{ matrix.user.isRoot}}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- run: ./dev/ci/setup-host cxx
- run: ./dev/ci/run-tests-with-docker cxx
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -63,6 +67,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- run: ./dev/ci/setup-host ${{ matrix.integration.label }}
- run: ./dev/ci/run-tests-with-docker ${{ matrix.integration.label }}
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -92,6 +100,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- run: ./dev/ci/setup-host ${{matrix.lang.name}}
- run: ./dev/ci/run-tests-with-docker ${{matrix.lang.name}}
if: matrix.os == 'ubuntu-latest'
Expand All @@ -109,6 +121,10 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- run: ./dev/ci/setup-host homebrew-packaging
- run: ./dev/ci/run-tests-natively homebrew-packaging
- uses: actions/upload-artifact@v4
Expand All @@ -123,6 +139,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- run: ./dev/ci/setup-host source-packaging
- run: ./dev/ci/run-tests-with-docker source-packaging
- uses: actions/upload-artifact@v4
Expand Down
20 changes: 12 additions & 8 deletions dev/ci/lib/set-container-envvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ else
fi

if [[ -f ~/.rvm/scripts/rvm ]]; then
# shellcheck source=/dev/null
source ~/.rvm/scripts/rvm
else
# shellcheck source=/dev/null
source /usr/local/rvm/scripts/rvm
fi

if [[ "$TEST_RUBY_VERSION" != "" ]]; then
# shellcheck source=/dev/null
source ~/.rvm/scripts/rvm
if [[ "$TEST_RUBY_VERSION" != "" ]]; then
header2 "Using Ruby version $TEST_RUBY_VERSION"
run rvm use "$TEST_RUBY_VERSION"
echo
fi
elif [[ -f /usr/local/rvm/scripts/rvm ]]; then
# shellcheck source=/dev/null
source /usr/local/rvm/scripts/rvm
if [[ "$TEST_RUBY_VERSION" != "" ]]; then
header2 "Using Ruby version $TEST_RUBY_VERSION"
run rvm use "$TEST_RUBY_VERSION"
echo
fi
fi

# RVM's cd override causes problems (probably thanks to bash
Expand Down

0 comments on commit ed295d2

Please sign in to comment.