Skip to content

Commit e0c2a29

Browse files
committed
add bundler constraint to install compatible versions with ruby versions
1 parent 4303c40 commit e0c2a29

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ jobs:
1919
bundler-cache: true
2020
- name: Build and run tests
2121
run: |
22-
gem install bundler
22+
RUBY_VERSION_STR="${{ matrix.ruby-version }}"
23+
case "$RUBY_VERSION_STR" in
24+
2.6*) BUNDLER_CONSTRAINT=">= 2, < 3" ;;
25+
2.7*) BUNDLER_CONSTRAINT=">= 2, < 4" ;;
26+
3.*) BUNDLER_CONSTRAINT=">= 3, < 4" ;;
27+
*) BUNDLER_CONSTRAINT=">= 2" ;;
28+
esac
29+
30+
gem install bundler -v "$BUNDLER_CONSTRAINT"
31+
echo "Bundler installed: $(bundle -v)"
2332
bundle install --jobs 4 --retry 3
2433
bundle exec rake

0 commit comments

Comments
 (0)