Skip to content

Commit 5c93cd0

Browse files
committed
improve GH Action: test w/ faraday 1.x & 2.x on various ruby's
- run tests w/ the generated gemfiles so when a ruby version fails it's shown as a separate failure in GHA
1 parent 0d65d13 commit 5c93cd0

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
test:
21-
runs-on: ubuntu-22.04
20+
test_ruby_version:
21+
runs-on: ubuntu-latest
22+
name: ruby-${{ matrix.ruby }}, ${{ matrix.gemfile }}
2223
strategy:
2324
fail-fast: false
2425
matrix:
@@ -27,13 +28,36 @@ jobs:
2728
- "3.1"
2829
- "3.2"
2930
- "3.3"
31+
- "3.4"
32+
gemfile:
33+
- "faraday_1.x"
34+
- "faraday_2.x"
35+
env:
36+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
3037
steps:
3138
- uses: actions/checkout@v4
3239
- name: Set up Ruby
3340
uses: ruby/setup-ruby@v1
3441
with:
3542
ruby-version: ${{ matrix.ruby }}
3643
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
44+
- name: Configure bundler
45+
run: |
46+
bundle config path vendor/bundle
47+
- name: Create bundler lockfile
48+
run: |
49+
bundle lock
50+
- uses: actions/cache@v3
51+
with:
52+
# NOTE: Bundler expands the path relative to the gemfile, not the
53+
# current directory.
54+
path: ./gemfiles/vendor/bundle
55+
key: bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles( 'gemfiles/*.lock' ) }}
56+
restore-keys: |
57+
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-
58+
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-
59+
- name: Install gems
60+
run: |
61+
bundle install --jobs 4
3762
- name: Run tests
3863
run: bundle exec rake
39-

0 commit comments

Comments
 (0)