diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dd95871 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish Gem + +on: + release: + types: + - "created" + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Publish to RubyGems + run: | + mkdir -p $HOME/.gem + touch $HOME/.gem/credentials + chmod 0600 $HOME/.gem/credentials + printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials + gem build sinject.gemspec + gem push sinject-*.gem + env: + GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dd90297 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: CI + +on: [push] + +jobs: + test: + strategy: + fail-fast: false + matrix: + # All the (nominally) supported Ruby versions + ruby: ['2.5', '2.6', '2.7', '3.0', '3.2', '3.3'] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Run tests + run: bundle exec rspec + + - name: Upload Coverage Report to CodeClimate + # No sense uploading coverage for each Ruby version tested + if: ${{matrix.ruby == '3.3'}} + uses: paambaati/codeclimate-action@v5 + env: + CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b2139f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: ruby -rvm: - - 2.5.9 - - 2.6.7 - - 2.7.3 -cache: bundler -before_script: ./script/before.sh -script: - - bundle exec rspec -after_script: ./script/after.sh -branches: - only: - - master - - /v\d+\.\d+\.\d+/ -deploy: - provider: rubygems - api_key: - secure: CW0mk2zA6BfW3D2ZAoSKPzN6e8zVC85oeJycwnQvdUdE5XdfXNzNYcZP1MbyXgUsqphdpKtVT7VJDvlK5/mK6xb++29IwNpIlHkgzKJX3DuiXjxR9G9owHAS2ltlJlRdTuur8ewJPUHSo4W9vXJt2ix9GFZpdYGlG8SBbUy36QpeS7AeRBgmluQkCkz4tw7/VWD/CMaeKNr/hOv690NDmqdSQ5JkZUHWS1+3IjsCe8K+6/KeUv77HY+CkAIqVaViNV03DKgyzdtwE7/KYxyFW45kQGsr5xDFbpOYMaRjFeJQBFqAPFY0rXW+bAmMZERkVb8F5XT6wgUS0u7o6bGFEe+hnAE59U27zcE2BA6cOdu+ZZVldZQLRudl6ustWBjIqSQ/lH22wqaaJb3HHjAbpdt704qctoQm2SYosqklJWIM1sdwQskHheMO8pnEg/A22NpBitlw4imPRidFf3QzfjYeEsazNpqGqNFGNoC+a6vD1ozpYrQfo9vN683awhety3aPilVNN/dIf86azvBlPWdDyTas6mQCipZAvWtzg8u82/ad7+J0VgGI7CqBxhClFlIx/y2QYtz/AbhHNAD5a0DAcCTAHWiJ1Iltg8ae2Vq6+3ACDnaDc+uXjLXpAy9PX/zFEKgXetiiggjDTBEflbwhdWtifwg/EIilDcl/dDw= - gem: sinject - on: - tags: true - repo: Sage/sinject - condition: "$TRAVIS_RUBY_VERSION == 2.5.9" -env: - global: - secure: qi/b+Aa5N/mrQ7XfnwHrnou+irh2WW6kGJdbyCOJMymwoqQ2D8kVxRcJP/PPNC3lRoJ6KjRyf3qV8LeYv8zHGP88SQzKdrpyyw7B/I7Cvuz6DLr4JXo5afrqX6lnC8iHsqCMAC7vGMFWQ0/HTapFSUFw3ahrAfFKSr68vGhdZst/2hXq4yVzoJE5TFZYXoYwAGbsJQDtU0gWbJhWa2o+Ay2bSx8T2t6Hngxc4TCvpl9tTNS77BAR9PwA/ZSuwM5Ht9JZ6WC3tg/rihkEmqx052BWug3NleVuTvO9LArGe/nkzlgGwli3aMv02+dG5cbGEMttuBI0EWFxj3CjPYA3aH7htGZZepuj9l8wh8dgrwmWYxz7od0/sFwD0vs4SNZbjbO6grGAsEiEKZRUG15+dg1oAjSBQ524cLmNarJAsiGhQWkREvBnFVTvPZen4skKIQdBxvLF7PUvzv8aWi31zsnRXlAUcNFXAysD1vEgGwxcpJ51MbXmej02JgPjTIY6s9uTdVMRDZa6eG2D9ybyh06N+Vr8t96p2Wui/CMWtXPVhROjDn+TN55Dl/Q+SLwWcyzzud+0pwwx09kVjCWWceiQsJjH+9tbRSCcrt6f0y3roBsShcsZAOWiDr7Eq5oyR7wcyUgu60c2Bxo2syJa43kO3p81OYQEb7R/8HTDPaQ= diff --git a/sinject.gemspec b/sinject.gemspec index 1159d8e..f5766de 100644 --- a/sinject.gemspec +++ b/sinject.gemspec @@ -22,5 +22,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '>= 1.11' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'simplecov', '~> 0.21.2' + spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'simplecov_json_formatter' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1aec431..8e62d61 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,8 @@ require 'simplecov' +require 'simplecov_json_formatter' + +SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter + SimpleCov.start do add_filter 'spec/' end