Skip to content

Commit

Permalink
set bundle path instead of chmod'ing sys gem path
Browse files Browse the repository at this point in the history
Alternative workaround to /opt/hostedtoolcache/Ruby being world writable
in the ubuntu 20240708.1.0 GA runner image.

See actions/runner-images#10215
  • Loading branch information
robbkidd committed Aug 8, 2024
1 parent 0afe5b9 commit d7ba5f4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/actions/test_gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,12 @@ runs:
ruby-version: "${{ inputs.ruby }}"
bundler: "latest"
working-directory: "${{ steps.setup.outputs.gem_dir }}"
# Perms workaround. See https://github.com/actions/runner-images/issues/10215
- name: Fix GEM_HOME permissions on GitHub Actions Runner
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
shell: bash
run: |
# 🛠️😭 Fix GEM_HOME permissions 😭🛠️
chmod -R o-w $(gem env home)
- name: Install dependencies and generate appraisals
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
shell: bash
run: |
# 💎 Install dependencies and generate appraisals 💎
bundle config path ${HOME}/.gem/ruby/${{ inputs.ruby }}
bundle install --quiet --jobs=3 --retry=4
bundle exec appraisal generate
working-directory: "${{ steps.setup.outputs.gem_dir }}"
Expand All @@ -105,6 +99,7 @@ runs:
if [[ -f "Appraisals" ]]; then
for i in `bundle exec appraisal list | sed 's/-/_/g' `; do
echo "::group::🔎 Appraising ${i}"
bundle config path ${HOME}/.gem/ruby/${{ inputs.ruby }}
BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle install --quiet --jobs=3 --retry=4 && \
BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle show && \
BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test || exit
Expand Down

0 comments on commit d7ba5f4

Please sign in to comment.