From de093d8bdd5be3e001e7b816393e405a0e75b692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Rodr=C3=ADguez?= Date: Wed, 6 Oct 2021 14:57:58 +0200 Subject: [PATCH] Migrate Travis CI to Github Actions --- .github/workflows/publish.yml | 23 +++++++++++++++++++++++ .github/workflows/rspec.yml | 24 ++++++++++++++++++++++++ .travis.yml | 23 ----------------------- Gemfile | 2 -- README.md | 2 +- class_kit.gemspec | 4 ++-- 6 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/rspec.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1a38e00 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +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 class_kit.gemspec + gem push class_kit-*.gem + env: + GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml new file mode 100644 index 0000000..eb8c926 --- /dev/null +++ b/.github/workflows/rspec.yml @@ -0,0 +1,24 @@ +name: RSpec +on: + - push +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.4 + bundler-cache: true + + - name: Run tests + run: bundle exec rspec + + - name: Code Coverage + uses: paambaati/codeclimate-action@v2.7.5 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + with: + coverageLocations: | + ${{github.workspace}}/coverage/.resultset.json:simplecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0f6e9e1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: ruby -rvm: - - 2.3.5 -cache: bundler -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 - > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - "./cc-test-reporter before-build" -after_script: - - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT" -deploy: - provider: rubygems - api_key: - secure: MYeZCI8j2iLvGb26A+aLoIZKg/cnVf/eVwJ1BKIt8e9vBz+FccjSOxASuJ+oJrlEcFNme8x/SEt6HA8//ID3m1DaOj6GK+Zj3fZYI2vVwJ3vIUDfqugdW4hkXTPixbdUf2hpISxfHRxeA3+1JFIjGPdJI8bcJOf7bbB5F/VsbRbIkaTQsj8EhpUsn3PpsV2qvP8CrRPTzU0Q3X4PVRTnaeV/bF8WCenmGsBNgEALjgR/gut2vogAP3j1zLIzxMw86gSxcexraPhYaT6pVnopjLFtJG6xHbv+R27ZKGlh3yx01ird7Frd1BGYD+Lh7Wsj1TxmTW3c2SGRHHJzZE6sgdVJqbAgccLOLsnQ4jVUYbdGxsptErwlAnD76SUM5L89sn6mq+RkljDenZ/aMvc8yu49atuTwsb73Ab1vwvfxFZw64Wv7zTDz6Ljn3TnGNIk1zqF7PrtSouAGrt0RpgMQwZmekppjMcKrr52xKoMtz0ImBD5ggqah52iajS6MlsG4fmPIlN6458SF36XabJzSv1Kih/8e9PpXANudrI91juMaIkEEQmCQSheVjXx9UleINgIF0/XVchK11BF0+iqAjZFHsaiSY7iaTr3oiv8FwQ1MQZeQdQ4b04qqzmJZz27dSm+Egp5cS+jN2iuC94SfDy54JmZaN/MRjWlCvPTX4g= - gem: class_kit - on: - tags: true - repo: Sage/class_kit - condition: "$TRAVIS_RUBY_VERSION == 2.3.5" -env: - global: - secure: fCykytE63DqQklyblIaKWzzGRLF2YARA79dRADgjtW2mZu5XVFN7a1xeeF1dvgWbWryiIRUgc0+kQ60O7J3NqnM/TTzCqdfXIF/A4IpSrS60uy9Pidag4kb3O/gxKGI1Gy86czOEy9tbRdmo50YjFeCX99JseA0JFBDpi/lDu+gxiFjulAC1JBdIyu/xb9kzwZpNUhl9PJzbFQlwjRfDn8pOnFGlsotDgUW4S7BJXiaYhy2QSOW4cIq5iwIGVL9hgB5LjsBS62h0wAqCQWNBzSoHZopOg4vyDYDNPKA5auCx6C/+D04yzo3TT1XuvXpshuT324AGEvD7ziKgaOypiKFl6aZ0FAVRzcIt25uPzahab1JRD4b2m73A/Y7QDDBrMhZ28KaOB7H95PnBADc/9VDSyneoK8mYY98yoE1WsNrKELA2R/y7DzbXXVoZ8cy4RP+3Vq5Qb2prWmi7QxNaZx4SDXt/bbc1DYsubSdMib4k03BGNHHOQ/defigZDzsByeke/dJir8KAYkrRCXU2V0rzwKX3zmFmmG7I3sCUWo4fHf6LVG6fz1U4tIuT7QG5HoobQT3l+oU7cYeOdPzC9Si2A7q4a+VPYAsKzEnLgpKbYoc3228/IlCkDo3vlZpirDuAScxg9iceupt3qCEfFaLXtGbDlEvq3k9ht8vVJHc= diff --git a/Gemfile b/Gemfile index 6386ff9..808c5bd 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,3 @@ source 'http://rubygems.org' # Specify your gem's dependencies in class_kit.gemspec gemspec - -gem 'json', '1.8.3' \ No newline at end of file diff --git a/README.md b/README.md index f5111ea..2d14250 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ClassKit -[![Build Status](https://travis-ci.org/Sage/class_kit.svg?branch=master)](https://travis-ci.org/Sage/class_kit) +[![RSpec](https://github.com/Sage/class_kit/actions/workflows/rspec.yml/badge.svg)](https://github.com/Sage/class_kit/actions/workflows/rspec.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/0bc83e414eed8759a0e8/maintainability)](https://codeclimate.com/github/Sage/class_kit/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/0bc83e414eed8759a0e8/test_coverage)](https://codeclimate.com/github/Sage/class_kit/test_coverage) [![Gem Version](https://badge.fury.io/rb/class_kit.svg)](https://badge.fury.io/rb/class_kit) diff --git a/class_kit.gemspec b/class_kit.gemspec index c88682d..4f78289 100644 --- a/class_kit.gemspec +++ b/class_kit.gemspec @@ -18,11 +18,11 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.11' + spec.add_development_dependency 'bundler', '~> 2' spec.add_development_dependency 'pry' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec' - spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'simplecov', '< 0.18.0' spec.add_dependency 'hash_kit' spec.add_dependency 'json'