diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3188a3a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +--- +name: CI +on: + push: + branches: + - master + paths-ignore: + - "benchmarks/**" + - "bin/**" + - "*.md" + pull_request: + branches: + - master + paths-ignore: + - "benchmarks/**" + - "bin/**" + - "*.md" +jobs: + tests: + name: Ruby ${{ matrix.ruby }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + ruby: + - 2.3 + - 2.4 + - 2.5 + - 2.6 + - 3.0 + - ruby-head + - jruby-9.2.13.0 + - jruby-head + - truffleruby-head + include: + - ruby: 2.1 + os: ubuntu-latest + coverage: false + bundler: 1 + - ruby: 2.2 + os: ubuntu-latest + coverage: false + bundler: 1 + - ruby: 2.7 + os: ubuntu-latest + coverage: true + bundler: latest + env: + COVERAGE: ${{ matrix.coverage }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler: ${{ matrix.bundler }} + - name: Install dependencies + run: bundle install --jobs 4 --retry 3 + - name: Run tests + run: bundle exec rake ci diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 57bdb18..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -language: ruby -before_install: "gem install bundler -v '< 2.0'" -script: bundle exec rake ci -rvm: - - 2.0.0 - - 2.1.10 - - 2.2.10 - - 2.3.8 - - 2.4.9 - - 2.5.7 - - 2.6.5 - - 2.7.0 - - ruby-head - - jruby-9.2.6.0 - - jruby-head -matrix: - allow_failures: - - rvm: ruby-head - - rvm: jruby-head - - rvm: jruby-9.2.6.0 - fast_finish: true -branches: - only: master diff --git a/README.md b/README.md index e59b341..33cb847 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ # Strings::Inflection [![Gem Version](https://badge.fury.io/rb/strings-inflection.svg)][gem] -[![Build Status](https://secure.travis-ci.org/piotrmurach/strings-inflection.svg?branch=master)][travis] +[![Actions CI](https://github.com/piotrmurach/strings-inflection/workflows/CI/badge.svg?branch=master)][gh_actions_ci] [![Build status](https://ci.appveyor.com/api/projects/status/huj82599jbk2quv2?svg=true)][appveyor] [![Maintainability](https://api.codeclimate.com/v1/badges/f7ecb5bf87696e522ccb/maintainability)][codeclimate] [![Coverage Status](https://coveralls.io/repos/github/piotrmurach/strings-inflection/badge.svg?branch=master)][coverage] [![Inline docs](http://inch-ci.org/github/piotrmurach/strings-inflection.svg?branch=master)][inchpages] [gem]: http://badge.fury.io/rb/strings-inflection -[travis]: http://travis-ci.org/piotrmurach/strings-inflection +[gh_actions_ci]: https://github.com/piotrmurach/strings-inflection/actions?query=workflow%3ACI [appveyor]: https://ci.appveyor.com/project/piotrmurach/strings-inflection [codeclimate]: https://codeclimate.com/github/piotrmurach/strings-inflection/maintainability [coverage]: https://coveralls.io/github/piotrmurach/strings-inflection?branch=master diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 29ee87a..5a2c9db 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -if ENV["COVERAGE"] || ENV["TRAVIS"] +if ENV["COVERAGE"] == "true" require "simplecov" require "coveralls"