Skip to content
Open
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
94 changes: 90 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ permissions:
contents: read

jobs:
test:
runs-on: ubuntu-22.04
test_ruby_version:
runs-on: ubuntu-latest
name: ruby-${{ matrix.ruby }}, ${{ matrix.gemfile }}
strategy:
fail-fast: false
matrix:
Expand All @@ -27,14 +28,99 @@ jobs:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
gemfile:
- "faraday_1.x"
- "faraday_2.x"
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Configure bundler
run: |
bundle config path vendor/bundle
- name: Create bundler lockfile
run: |
bundle lock
- uses: actions/cache@v3
with:
# NOTE: Bundler expands the path relative to the gemfile, not the
# current directory.
path: ./gemfiles/vendor/bundle
key: bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles( 'gemfiles/*.lock' ) }}
restore-keys: |
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-
- name: Install gems
run: |
bundle install --jobs 4
- name: Run tests
run: bundle exec rake

test_active_support:
needs: test_ruby_version
runs-on: ubuntu-latest
name: ruby-${{ matrix.ruby }}, ${{ matrix.gemfile }}, ${{ matrix.faraday }}
strategy:
fail-fast: false
# https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
faraday:
- "faraday_1.x"
- "faraday_2.x"
gemfile:
- "activesupport_6.0"
- "activesupport_6.1"
- "activesupport_7.0"
- "activesupport_7.1"
- "activesupport_7.2"
- "activesupport_8.0"
exclude:
- ruby: "3.0"
gemfile: "activesupport_7.2"
- ruby: "3.0"
gemfile: "activesupport_8.0"
- ruby: "3.1"
gemfile: "activesupport_8.0"

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}_${{ matrix.faraday }}.gemfile
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Configure bundler
run: |
bundle config path vendor/bundle
- name: Create bundler lockfile
run: |
bundle exec appraisal install
bundle exec appraisal rake test
bundle lock
- uses: actions/cache@v3
with:
# NOTE: Bundler expands the path relative to the gemfile, not the
# current directory.
path: ./gemfiles/vendor/bundle
key: bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ matrix.faraday }}-${{ hashFiles( 'gemfiles/*.lock' ) }}
restore-keys: |
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ matrix.faraday }}
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-
bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-
- name: Install gems
run: |
bundle install --jobs 4
- name: Run tests
run: bundle exec rake
83 changes: 77 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,25 +1,96 @@
appraise 'activesupport-6.0' do
appraise 'activesupport-6.0-faraday-1.x' do
gem 'activesupport', '~> 6.0.0'
gem 'activemodel', '~> 6.0.0'
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
gem 'concurrent-ruby', '1.3.4'
end

appraise 'activesupport-6.1' do
appraise 'activesupport-6.1-faraday-1.x' do
gem 'activesupport', '~> 6.1.0'
gem 'activemodel', '~> 6.1.0'
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
gem 'concurrent-ruby', '1.3.4'
end

appraise 'activesupport-7.0' do
appraise 'activesupport-7.0-faraday-1.x' do
gem 'activesupport', '~> 7.0.0'
gem 'activemodel', '~> 7.0.0'
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
gem 'concurrent-ruby', '1.3.4'
end

appraise 'activesupport-7.1' do
appraise 'activesupport-7.1-faraday-1.x' do
gem 'activesupport', '~> 7.1.0'
gem 'activemodel', '~> 7.1.0'
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
end

appraise 'faraday-1.x' do
appraise 'activesupport-7.2-faraday-1.x' do
gem 'activesupport', '~> 7.2.0'
gem 'activemodel', '~> 7.2.0'
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
end

appraise 'faraday-2.x' do
appraise 'activesupport-8.0-faraday-1.x' do
gem 'activesupport', '~> 8.0.0'
gem 'activemodel', '~> 8.0.0'
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
end

appraise 'activesupport-6.0-faraday-2.x' do
gem 'activesupport', '~> 6.0.0'
gem 'activemodel', '~> 6.0.0'
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end

appraise 'activesupport-6.1-faraday-2.x' do
gem 'activesupport', '~> 6.1.0'
gem 'activemodel', '~> 6.1.0'
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end

appraise 'activesupport-7.0-faraday-2.x' do
gem 'activesupport', '~> 7.0.0'
gem 'activemodel', '~> 7.0.0'
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end

appraise 'activesupport-7.1-faraday-2.x' do
gem 'activesupport', '~> 7.1.0'
gem 'activemodel', '~> 7.1.0'
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end

appraise 'activesupport-7.2-faraday-2.x' do
gem 'activesupport', '~> 7.2.0'
gem 'activemodel', '~> 7.2.0'
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end

appraise 'activesupport-8.0-faraday-2.x' do
gem 'activesupport', '~> 8.0.0'
gem 'activemodel', '~> 8.0.0'
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end

appraise 'faraday-1.x' do
gem 'faraday', '~> 1.10' # depends on Ruby (>= 2.4)
gem 'faraday-gzip', '~> 1.0' # depends on Ruby (< 4, >= 2.6)
end

appraise 'faraday-2.x' do
gem 'faraday', '~> 2.0' # depends on Ruby (>= 2.6)
gem 'faraday-gzip', '~> 2.0' # depends on Ruby (< 4, >= 2.6)
end
11 changes: 2 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ source "https://rubygems.org"

gemspec

gem 'rake'

gem "activesupport", ">= 4.0.13"
gem 'addressable', '~> 2.2'

gem "codeclimate-test-reporter", group: :test, require: nil

group :development, :test do
gem 'byebug', '~> 10.0', platforms: [:mri_20, :mri_21, :mri_22]
group :test do
gem "codeclimate-test-reporter", require: nil
end
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,24 @@ Contributions are welcome! Please fork this repo and send a pull request. Your p
Ideally, the PR has 2 commits - the first showing the failed test and the second with the fix - although this is not
required. The commits will be squashed into master once accepted.

### Set up development locally

- With a decent ruby version:
```shell
bundle install
appraisal install
```

- Run all tests for that ruby version:
```shell
appraisal rake
```

- For more info on appraisal:
```shell
appraisal help
```

## Changelog

See [changelog](https://github.com/JsonApiClient/json_api_client/blob/master/CHANGELOG.md)
14 changes: 0 additions & 14 deletions gemfiles/activesupport_6.0.gemfile

This file was deleted.

15 changes: 15 additions & 0 deletions gemfiles/activesupport_6.0_faraday_1.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 6.0.0"
gem "activemodel", "~> 6.0.0"
gem "faraday", "~> 1.10"
gem "faraday-gzip", "~> 1.0"
gem "concurrent-ruby", "1.3.4"

group :test do
gem "codeclimate-test-reporter", require: nil
end

gemspec path: "../"
14 changes: 14 additions & 0 deletions gemfiles/activesupport_6.0_faraday_2.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 6.0.0"
gem "activemodel", "~> 6.0.0"
gem "faraday", "~> 2.0"
gem "faraday-gzip", "~> 2.0"

group :test do
gem "codeclimate-test-reporter", require: nil
end

gemspec path: "../"
14 changes: 0 additions & 14 deletions gemfiles/activesupport_6.1.gemfile

This file was deleted.

15 changes: 15 additions & 0 deletions gemfiles/activesupport_6.1_faraday_1.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 6.1.0"
gem "activemodel", "~> 6.1.0"
gem "faraday", "~> 1.10"
gem "faraday-gzip", "~> 1.0"
gem "concurrent-ruby", "1.3.4"

group :test do
gem "codeclimate-test-reporter", require: nil
end

gemspec path: "../"
14 changes: 14 additions & 0 deletions gemfiles/activesupport_6.1_faraday_2.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 6.1.0"
gem "activemodel", "~> 6.1.0"
gem "faraday", "~> 2.0"
gem "faraday-gzip", "~> 2.0"

group :test do
gem "codeclimate-test-reporter", require: nil
end

gemspec path: "../"
14 changes: 0 additions & 14 deletions gemfiles/activesupport_7.0.gemfile

This file was deleted.

15 changes: 15 additions & 0 deletions gemfiles/activesupport_7.0_faraday_1.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 7.0.0"
gem "activemodel", "~> 7.0.0"
gem "faraday", "~> 1.10"
gem "faraday-gzip", "~> 1.0"
gem "concurrent-ruby", "1.3.4"

group :test do
gem "codeclimate-test-reporter", require: nil
end

gemspec path: "../"
14 changes: 14 additions & 0 deletions gemfiles/activesupport_7.0_faraday_2.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 7.0.0"
gem "activemodel", "~> 7.0.0"
gem "faraday", "~> 2.0"
gem "faraday-gzip", "~> 2.0"

group :test do
gem "codeclimate-test-reporter", require: nil
end

gemspec path: "../"
Loading