From c5845c52a3188c85282d02baf6a4155681b1e342 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 23 Sep 2024 11:57:30 +0200 Subject: [PATCH 1/2] README: use GitHub Actions-based badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a7cd41..2f6c1e1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Faraday Middleware ================== [![Gem Version](https://badge.fury.io/rb/faraday_middleware.svg)](https://rubygems.org/gems/faraday_middleware) -![GitHub Actions CI](https://github.com/lostisland/faraday_middleware/workflows/CI/badge.svg) +[![CI](https://github.com/lostisland/faraday_middleware/actions/workflows/ci.yml/badge.svg)](https://github.com/lostisland/faraday_middleware/actions/workflows/ci.yml) A collection of useful [Faraday][] middleware. [See the documentation][docs]. From 186641007e6a55a9b7d851ff2825f5259f760479 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 23 Sep 2024 12:22:41 +0200 Subject: [PATCH 2/2] CI: Trust ruby/setup-ruby to install gems (#290) * use yard-junk supported by our Ruby. Deal with "yard-junk now requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210." * install ostruct and add RUBYOPT -r ostruct for linting * apt-get update first * keep publish.yml up to date --- .github/workflows/ci.yml | 30 ++++++++++++++---------------- .github/workflows/publish.yml | 4 ++-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5b5015..cf53d02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 - 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] @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1d82021..a720e9f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: |