diff --git a/.circleci/config.yml b/.circleci/config.yml index 544ca59..a998cfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,9 +5,9 @@ version: 2.1 orbs: ruby: circleci/ruby@2.5 node: circleci/node@7.1 - sonarcloud: sonarsource/sonarcloud@2.0 + sonarcloud: sonarsource/sonarcloud@3.0 asdf: rynkowsg/asdf@0.2 - codecov: codecov/codecov@5.2 + codecov: codecov/codecov@5.4 github: circleci/github-cli@2.7 # Pipeline parameters @@ -18,7 +18,7 @@ parameters: default: main default-ruby: type: string - default: 3.3.8 + default: 3.4.5 # Define common YAML anchors x-common-auth: &common-auth @@ -30,12 +30,12 @@ x-common-auth: &common-auth executors: docker: # Docker using the Base Convenience Image docker: - - image: cimg/base:stable + - image: cimg/base:current <<: *common-auth macos: # macOS executor running Xcode macos: # https://circleci.com/developer/machine/image/xcode - xcode: 16.2.0 + xcode: 16.4.0 jobs: # Lint Job @@ -54,17 +54,32 @@ jobs: imagemagick libvips42 libffi-dev libreadline-dev \ libyaml-dev openssl libtool - asdf/install + - run: + name: Set default Ruby to << pipeline.parameters.default-ruby >> + command: echo "ruby << pipeline.parameters.default-ruby >>" > ~/.tool-versions + # Restore ASDF cache + - restore_cache: + name: Restore ASDF cache + keys: + - asdf-docker-<< pipeline.parameters.default-ruby >> # Install requested Ruby version - run: name: Install Ruby << pipeline.parameters.default-ruby >> command: | asdf plugin add ruby - asdf install ruby << pipeline.parameters.default-ruby >> - echo "ruby << pipeline.parameters.default-ruby >>" > ~/.tool-versions + ASDF_RUBY_BUILD_VERSION=master asdf install ruby << pipeline.parameters.default-ruby >> gem install --user-install executable-hooks + # Save ASDF cache + - save_cache: + name: Save ASDF cache + key: asdf-docker-<< pipeline.parameters.default-ruby >> + paths: + - ~/.asdf/installs + - ~/.asdf/plugins + - ~/.asdf/shims # Install dependencies using bundler - ruby/install-deps: - key: gems-v{{ .Environment.CACHE_VERSION }} + key: gems-v{{ .Environment.CACHE_VERSION }}-{{ checksum "~/.tool-versions" }} # Run Rubocop - run: name: Run Rubocop @@ -113,19 +128,34 @@ jobs: name: Install ImageMagick, libvips and libffi command: | brew install openssl@3 imagemagick vips asdf libffi + - run: + name: Install Ruby << parameters.ruby-version >> + command: echo "ruby << parameters.ruby-version >>" > ~/.tool-versions + # Restore ASDF cache + - restore_cache: + name: Restore ASDF cache + keys: + - asdf-<< parameters.os >>-<< parameters.ruby-version >> # Install requested Ruby version - run: name: Install Ruby << parameters.ruby-version >> command: | asdf plugin add ruby - asdf install ruby << parameters.ruby-version >> - echo "ruby << parameters.ruby-version >>" > ~/.tool-versions + ASDF_RUBY_BUILD_VERSION=master asdf install ruby << parameters.ruby-version >> gem install --user-install executable-hooks + # Save ASDF cache + - save_cache: + name: Save ASDF cache + key: asdf-<< parameters.os >>-<< parameters.ruby-version >> + paths: + - ~/.asdf/installs + - ~/.asdf/plugins + - ~/.asdf/shims # Check out code - checkout # Install dependencies using bundler - ruby/install-deps: - key: gems-v{{ .Environment.CACHE_VERSION }} + key: gems-v{{ .Environment.CACHE_VERSION }}-{{ checksum "~/.tool-versions" }} # Run RSpec tests - run: name: Run tests @@ -162,7 +192,7 @@ jobs: # Sonarcloud Job sonarcloud: docker: - - image: cimg/openjdk:21.0-node + - image: cimg/base:current <<: *common-auth resource_class: small steps: @@ -186,7 +216,7 @@ jobs: # Release Job release: docker: - - image: cimg/base:stable + - image: cimg/base:current <<: *common-auth resource_class: medium+ environment: @@ -205,21 +235,36 @@ jobs: libyaml-dev openssl libtool libz-dev libjemalloc-dev \ libgmp-dev build-essential ruby-dev libssl-dev zlib1g-dev - asdf/install + - run: + name: Set default Ruby to << pipeline.parameters.default-ruby >> + command: echo "ruby << pipeline.parameters.default-ruby >>" > ~/.tool-versions + # Restore ASDF cache + - restore_cache: + name: Restore ASDF cache + keys: + - asdf-docker-<< pipeline.parameters.default-ruby >> # Install requested Ruby version - run: name: Install Ruby << pipeline.parameters.default-ruby >> command: | asdf plugin add ruby - asdf install ruby << pipeline.parameters.default-ruby >> - echo "ruby << pipeline.parameters.default-ruby >>" > ~/.tool-versions + ASDF_RUBY_BUILD_VERSION=master asdf install ruby << pipeline.parameters.default-ruby >> gem install --user-install executable-hooks + # Save ASDF cache + - save_cache: + name: Save ASDF cache + key: asdf-docker-<< pipeline.parameters.default-ruby >> + paths: + - ~/.asdf/installs + - ~/.asdf/plugins + - ~/.asdf/shims - checkout - run: name: Check out main branch command: git checkout --force "${GIT_MAIN_BRANCH}" # Install dependencies using bundler - ruby/install-deps: - key: gems-v{{ .Environment.CACHE_VERSION }} + key: gems-v{{ .Environment.CACHE_VERSION }}-{{ checksum "~/.tool-versions" }} - run: name: Build and push gem command: | @@ -299,7 +344,7 @@ workflows: matrix: parameters: os: ["docker", "macos"] - ruby-version: ["3.3.8", "3.2.3", "3.1.6"] + ruby-version: ["3.4.5", "3.3.9", "3.2.9", "3.1.7"] filters: tags: only: /^\d+\.\d+\.\d+$/ @@ -321,7 +366,6 @@ workflows: - SonarCloud requires: - lint - - test filters: tags: only: /^\d+\.\d+\.\d+$/ diff --git a/.tool-versions b/.tool-versions index e12c94f..b395ac1 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 3.3.8 3.2.3 3.1.6 +ruby 3.4.5 3.3.9 3.2.9 3.1.7 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..bf5458c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "sonarlint.connectedMode.project": { + "connectionId": "remove-bg", + "projectKey": "remove-bg_ruby" + } +} diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..7c87527 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,19 @@ +--- + +extends: default + +yaml-files: + - '*.yaml' + - '*.yml' + +rules: + line-length: + max: 250 + level: warning + +ignore: | + rspec + resources + gemfiles + examples + .git diff --git a/Appraisals b/Appraisals index 73306af..bb7cef2 100644 --- a/Appraisals +++ b/Appraisals @@ -50,6 +50,26 @@ appraise "faraday-2-9" do gem "faraday", "~> 2.9.0" end +# Faraday 2.10 +appraise "faraday-2-10" do + gem "faraday", "~> 2.10.0" +end + +# Faraday 2.11 +appraise "faraday-2-11" do + gem "faraday", "~> 2.11.0" +end + +# Faraday 2.12 +appraise "faraday-2-12" do + gem "faraday", "~> 2.12.0" +end + +# Faraday 2.13 +appraise "faraday-2-13" do + gem "faraday", "~> 2.13.0" +end + # Latest in Faraday 2.x series appraise "faraday-2-x" do gem "faraday", "~> 2", "< 3" diff --git a/gemfiles/faraday_2_10.gemfile b/gemfiles/faraday_2_10.gemfile new file mode 100644 index 0000000..269bce2 --- /dev/null +++ b/gemfiles/faraday_2_10.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "faraday", "~> 2.10.0" + +gemspec path: "../" diff --git a/gemfiles/faraday_2_11.gemfile b/gemfiles/faraday_2_11.gemfile new file mode 100644 index 0000000..863f076 --- /dev/null +++ b/gemfiles/faraday_2_11.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "faraday", "~> 2.11.0" + +gemspec path: "../" diff --git a/gemfiles/faraday_2_12.gemfile b/gemfiles/faraday_2_12.gemfile new file mode 100644 index 0000000..1dc2a2c --- /dev/null +++ b/gemfiles/faraday_2_12.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "faraday", "~> 2.12.0" + +gemspec path: "../" diff --git a/gemfiles/faraday_2_13.gemfile b/gemfiles/faraday_2_13.gemfile new file mode 100644 index 0000000..f690631 --- /dev/null +++ b/gemfiles/faraday_2_13.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "faraday", "~> 2.13.0" + +gemspec path: "../"