From ba7684f0bd5cf7588f95636f2fe150c4cd600789 Mon Sep 17 00:00:00 2001 From: Marc Siegel Date: Mon, 11 Apr 2022 14:33:52 -0400 Subject: [PATCH] Move Gemfile CI-only dependencies to test group (#91) We want to be careful to avoid accidentally bringing in runtime dependencies to projects which use Docile. In this PR, we clarify explicitly that the CI-only dependency on simplecov-cobertura, which is the formatt used by CodeCov, is a test dependency, and not a runtime dependency. Without this change, it may be possible that projects which use Docile, when running in an environment with CI=true, would accidentally bring in this test-only dependency, when that isn't intended. - Remove unnecessary quoting of '3.1' in .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- Gemfile | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd81689..0c0fdb0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [ubuntu-latest] # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: [jruby, truffleruby, 2.5, 2.6, 2.7, '3.0', '3.1', head] + ruby: [jruby, truffleruby, 2.5, 2.6, 2.7, '3.0', 3.1, head] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3.0.0 diff --git a/Gemfile b/Gemfile index 4ebdeca..9e3f78c 100644 --- a/Gemfile +++ b/Gemfile @@ -2,17 +2,17 @@ source "https://rubygems.org" -# CI-only dependencies go here -if ENV["CI"] == "true" # rubocop:disable Style/IfUnlessModifier - gem "simplecov-cobertura", require: false, group: "test" -end - -# Specify gem's dependencies in docile.gemspec +# Specify gem's runtime dependencies in docile.gemspec gemspec group :test do gem "rspec", "~> 3.10" gem "simplecov", require: false + + # CI-only test dependencies go here + if ENV["CI"] == "true" + gem "simplecov-cobertura", require: false, group: "test" + end end # Excluded from CI except on latest MRI Ruby, to reduce compatibility burden