From de4ff5db3b6d5ddfcc54b3193cb6af8a0450d99d Mon Sep 17 00:00:00 2001 From: Lucas Caton Date: Sat, 23 Jan 2021 17:30:08 +1000 Subject: [PATCH] Replace Travis with GitHub Actions --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 37 ----------------------------- README.md | 4 ++-- 3 files changed, 53 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f12a010 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + strategy: + fail-fast: false + + matrix: + ruby: + - 2.5 + - 2.6 + - 2.7 + - 3.0 + gemfile: + - gemfiles/rails_5.0.gemfile + - gemfiles/rails_5.1.gemfile + - gemfiles/rails_5.2.gemfile + - gemfiles/rails_6.0.gemfile + - gemfiles/rails_6.1.gemfile + exclude: + # Rails < 6 does not support Ruby 3+: + # https://github.com/rails/rails/issues/40938#issuecomment-751357907 + - ruby: 3.0 + gemfile: gemfiles/rails_5.0.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_5.1.gemfile + - ruby: 3.0 + gemfile: gemfiles/rails_5.2.gemfile + + env: + BUNDLE_GEMFILE: "${{ matrix.gemfile }}" + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Rubocop + if: ${{ matrix.ruby == '3.0' }} + run: "bundle exec rubocop" + + - name: Tests + run: bundle exec rake spec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 514f478..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: ruby - -sudo: false - -cache: bundler - -script: - - "ruby -e \"RUBY_VERSION == '3.0.1' ? system('bundle exec rubocop') : exit(0)\"" - - bundle exec rake spec - -rvm: - - 2.5.9 - - 2.6.7 - - 2.7.3 - - 3.0.1 - -gemfile: - - gemfiles/rails_5.0.gemfile - - gemfiles/rails_5.1.gemfile - - gemfiles/rails_5.2.gemfile - - gemfiles/rails_6.0.gemfile - - gemfiles/rails_6.1.gemfile - -matrix: - exclude: - # Rails < 6 does not support Ruby 3+, see: - # https://github.com/rails/rails/issues/40938#issuecomment-751357907 - - rvm: 3.0.1 - gemfile: gemfiles/rails_5.0.gemfile - - rvm: 3.0.1 - gemfile: gemfiles/rails_5.1.gemfile - - rvm: 3.0.1 - gemfile: gemfiles/rails_5.2.gemfile - -addons: - code_climate: - repo_token: 60e4a18e2a4bc86a98f92847f16756876c13d1e772058a9b3296643b04a697d7 diff --git a/README.md b/README.md index 0b581b2..476a28a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Enumerations for Ruby with some magic powers! 🎩 -[![Build Status](https://travis-ci.org/lucascaton/enumerate_it.svg?branch=main)](https://travis-ci.org/lucascaton/enumerate_it) +[![CI Status](https://github.com/lucascaton/enumerate_it/workflows/CI/badge.svg)](https://github.com/lucascaton/enumerate_it/actions?query=workflow%3ACI) [![Gem Version](https://badge.fury.io/rb/enumerate_it.svg)](https://rubygems.org/gems/enumerate_it) [![Code Climate](https://codeclimate.com/github/lucascaton/enumerate_it/badges/gpa.svg)](https://codeclimate.com/github/lucascaton/enumerate_it) [![Downloads](https://img.shields.io/gem/dt/enumerate_it.svg)](https://rubygems.org/gems/enumerate_it) @@ -407,7 +407,7 @@ You sure can! 😄 * **Rails** `5.0+` All versions are tested via -[Travis](https://github.com/lucascaton/enumerate_it/blob/main/.travis.yml). +[GitHub Actions](https://github.com/lucascaton/enumerate_it/blob/HEAD/.github/workflows/ci.yml). #### Can I set a value to always be at the end of a sorted list?