Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Trust ruby/setup-ruby to install gems #290

Merged
merged 7 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,26 @@ env:
jobs:
linting:
runs-on: ubuntu-latest

env:
BUNDLE_WITHOUT: 'development test'
BUNDLE_WITH: 'lint'
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true # 'bundle install' and cache gems
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is very clever!
This way we don't need to guess the right bundler version, love it!


- name: Rubocop
run: |
gem install bundler
bundle config set without 'development test'
bundle config set with 'lint'
bundle install
bundle exec rubocop --format progress
run: bundle exec rubocop --format progress

# Deal with "yard-junk now requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210."
- name: Yard-Junk
run: |
gem install yard-junk --no-document
yard-junk --path lib
gem install ostruct
gem install yard-junk -v 0.0.9 --no-document
RUBYOPT='-r ostruct' yard-junk --path lib

build:
needs: [linting]
Expand All @@ -44,13 +43,12 @@ jobs:
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']

steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: sudo apt-get update && sudo apt install libcurl4-openssl-dev
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install system dependencies
run: sudo apt install libcurl4-openssl-dev
- name: Install Ruby dependencies
run: bundle install --jobs 4 --retry 3
bundler-cache: true # 'bundle install' and then cache gems
- name: Test
run: bundle exec rake
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.6

- name: Publish to RubyGems
run: |
Expand Down