57
57
# of the benefits of bundler caching.
58
58
rm -f "${dir}/Gemfile.lock"
59
59
60
- echo "cache_key=cruby " >> $GITHUB_OUTPUT
60
+ echo "cache_key=mri " >> $GITHUB_OUTPUT
61
61
if [[ "${{ inputs.ruby }}" == "jruby" ]]; then
62
62
echo "cache_key=jruby" >> $GITHUB_OUTPUT
63
63
elif [[ "${{ inputs.ruby }}" == "truffleruby" ]]; then
@@ -80,49 +80,57 @@ runs:
80
80
shell : bash
81
81
run : sudo apt update && sudo apt install -y imagemagick
82
82
83
+ # Install ruby and bundle dependencies and cache!
84
+ # ...but not for appraisals, sadly.
85
+ - name : Install Ruby ${{ inputs.ruby }} with dependencies
86
+ if : " ${{ steps.setup.outputs.appraisals == 'false' }}"
87
+
88
+ with :
89
+ ruby-version : " ${{ inputs.ruby }}"
90
+ working-directory : " ${{ steps.setup.outputs.gem_dir }}"
91
+ bundler : " latest"
92
+ bundler-cache : true
93
+ cache-version : " ${{ inputs.ruby }}-${{ steps.setup.outputs.cache_key }}"
94
+
83
95
# If we're using appraisals, do it all manually.
84
96
- name : Install Ruby ${{ inputs.ruby }} without dependencies
97
+ if : " ${{ steps.setup.outputs.appraisals == 'true' }}"
85
98
86
99
with :
87
- bundler : " latest"
88
100
ruby-version : " ${{ inputs.ruby }}"
101
+ bundler : " latest"
89
102
working-directory : " ${{ steps.setup.outputs.gem_dir }}"
90
-
91
- - name : Install dependencies
103
+ # Perms workaround. See https://github.com/actions/runner-images/issues/10215
104
+ - name : Fix GEM_HOME permissions on GitHub Actions Runner
105
+ if : " ${{ steps.setup.outputs.appraisals == 'true' }}"
92
106
shell : bash
93
107
run : |
94
- echo "::group:: 💎 Install dependencies and generate appraisals 💎"
95
- bundle install
96
-
97
- echo "::endgroup::"
98
- working-directory : " ${{ steps.setup.outputs.gem_dir }}"
99
-
108
+ # 🛠️😭 Fix GEM_HOME permissions 😭🛠️
109
+ chmod -R o-w $(gem env home)
100
110
- name : Install dependencies and generate appraisals
101
111
if : " ${{ steps.setup.outputs.appraisals == 'true' }}"
102
112
shell : bash
103
113
run : |
104
- echo "::group:: 💎 Install dependencies and generate appraisals 💎"
105
-
114
+ # 💎 Install dependencies and generate appraisals 💎
115
+ bundle install --quiet --jobs=3 --retry=4
106
116
bundle exec appraisal clean
107
117
bundle exec appraisal generate
108
-
109
- echo "::endgroup::"
110
118
working-directory : " ${{ steps.setup.outputs.gem_dir }}"
111
119
112
120
- name : Test Gem
113
121
shell : bash
114
122
run : |
123
+ # 🍿 Test Gem 🍿
115
124
if [[ -f "Appraisals" ]]; then
116
125
for i in `bundle exec appraisal list | sed 's/-/_/g' `; do
117
126
echo "::group::🔎 Appraising ${i}"
118
- bundle install --gemfile=gemfiles/${i}.gemfile --jobs=3 --retry=4
119
- bundle exec --gemfile=gemfiles/${i}.gemfile rake test
127
+ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle install --quiet --jobs=3 --retry=4 && \
128
+ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle show && \
129
+ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test || exit
120
130
echo "::endgroup::"
121
131
done
122
132
else
123
- echo "::group::🔎 Running Tests Standalone"
124
133
bundle exec rake test
125
- echo "::endgroup::"
126
134
fi
127
135
working-directory : " ${{ steps.setup.outputs.gem_dir }}"
128
136
env :
0 commit comments