From b1894eff44917b3c1d3e286956a51dbd3514202d Mon Sep 17 00:00:00 2001 From: Takuya Noguchi Date: Wed, 11 Aug 2021 03:59:37 +0000 Subject: [PATCH] Migrate CI from Travis CI to GitHub Actions Signed-off-by: Takuya Noguchi --- .github/workflows/ruby.yml | 108 +++++++++++++++++++++++++++++++++++++ .travis.yml | 80 --------------------------- CONTRIBUTING.md | 6 +-- Rakefile | 2 +- 4 files changed, 112 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/ruby.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..aaa9530 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,108 @@ +name: Ruby test + +on: [push, pull_request] + +jobs: + test: + name: Ruby test + runs-on: ubuntu-20.04 + continue-on-error: ${{ matrix.experimental }} + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + BUNDLE_JOBS: 4 + BUNDLE_RETRY: 3 + strategy: + fail-fast: false + matrix: + ruby: [ + 2.2.10, + 2.3.8, + 2.4.10, + 2.5.8, + 2.6.6, + 2.7.1, + 3.0.0 + ] + gemfile: [ + "rails_5_0", + "rails_5_1", + "rails_5_2", + "rails_6_0", + "rails_6_1", + "rails_head" + ] + experimental: [false] + exclude: + - ruby: 2.7.1 + gemfile: rails_5_0 + - ruby: 3.0.0 + gemfile: rails_5_0 + - ruby: head + gemfile: rails_5_0 + - ruby: 2.7.1 + gemfile: rails_5_1 + - ruby: 3.0.0 + gemfile: rails_5_1 + - ruby: head + gemfile: rails_5_1 + - ruby: 2.2.10 + gemfile: rails_5_2 + - ruby: 2.7.1 + gemfile: rails_5_2 + - ruby: 3.0.0 + gemfile: rails_5_2 + - ruby: head + gemfile: rails_5_2 + - ruby: 2.2.10 + gemfile: rails_6_0 + - ruby: 2.3.8 + gemfile: rails_6_0 + - ruby: 2.4.10 + gemfile: rails_6_0 + - ruby: 3.0.0 + gemfile: rails_6_0 + - ruby: head + gemfile: rails_6_0 + - ruby: 2.2.10 + gemfile: rails_6_1 + - ruby: 2.3.8 + gemfile: rails_6_1 + - ruby: 2.4.10 + gemfile: rails_6_1 + - ruby: 2.2.10 + gemfile: rails_head + - ruby: 2.3.8 + gemfile: rails_head + - ruby: 2.4.10 + gemfile: rails_head + - ruby: 2.5.8 + gemfile: rails_head + - ruby: 2.6.6 + gemfile: rails_head + - ruby: 2.7.1 + gemfile: rails_head + experimental: false + - ruby: 3.0.0 + gemfile: rails_head + experimental: false + include: + - ruby: 2.7.1 + gemfile: rails_head + experimental: true + - ruby: 3.0.0 + gemfile: rails_head + experimental: true + - ruby: head + gemfile: rails_head + experimental: true + + steps: + - uses: actions/checkout@v2 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Ruby test + run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 88f4ef3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,80 +0,0 @@ -language: ruby - -cache: bundler - -before_install: - - "gem install bundler -v '<2'" - -rvm: - - 2.2.10 - - 2.3.8 - - 2.4.10 - - 2.5.8 - - 2.6.6 - - 2.7.1 - - 3.0.0 - - ruby-head - -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 - - gemfiles/rails_head.gemfile - -matrix: - exclude: - - rvm: 2.7.1 - gemfile: gemfiles/rails_5_0.gemfile - - rvm: 3.0.0 - gemfile: gemfiles/rails_5_0.gemfile - - rvm: ruby-head - gemfile: gemfiles/rails_5_0.gemfile - - rvm: 2.7.1 - gemfile: gemfiles/rails_5_1.gemfile - - rvm: 3.0.0 - gemfile: gemfiles/rails_5_1.gemfile - - rvm: ruby-head - gemfile: gemfiles/rails_5_1.gemfile - - rvm: 2.2.10 - gemfile: gemfiles/rails_5_2.gemfile - - rvm: 2.7.1 - gemfile: gemfiles/rails_5_2.gemfile - - rvm: 3.0.0 - gemfile: gemfiles/rails_5_2.gemfile - - rvm: ruby-head - gemfile: gemfiles/rails_5_2.gemfile - - rvm: 2.2.10 - gemfile: gemfiles/rails_6_0.gemfile - - rvm: 2.3.8 - gemfile: gemfiles/rails_6_0.gemfile - - rvm: 2.4.10 - gemfile: gemfiles/rails_6_0.gemfile - - rvm: 3.0.0 - gemfile: gemfiles/rails_6_0.gemfile - - rvm: ruby-head - gemfile: gemfiles/rails_6_0.gemfile - - rvm: 2.2.10 - gemfile: gemfiles/rails_6_1.gemfile - - rvm: 2.3.8 - gemfile: gemfiles/rails_6_1.gemfile - - rvm: 2.4.10 - gemfile: gemfiles/rails_6_1.gemfile - - rvm: 2.2.10 - gemfile: gemfiles/rails_head.gemfile - - rvm: 2.3.8 - gemfile: gemfiles/rails_head.gemfile - - rvm: 2.4.10 - gemfile: gemfiles/rails_head.gemfile - - rvm: 2.5.8 - gemfile: gemfiles/rails_head.gemfile - - rvm: 2.6.6 - gemfile: gemfiles/rails_head.gemfile - allow_failures: - - rvm: ruby-head - - gemfile: gemfiles/rails_head.gemfile - fast_finish: true - -notifications: - email: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1abd71f..0ecd004 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,11 @@ Contributing to Jbuilder ===================== -[![Build Status](https://api.travis-ci.org/rails/jbuilder.svg?branch=master)][travis] +[![Build Status](https://github.com/rails/jbuilder/workflows/Ruby%20test/badge.svg)][test] [![Gem Version](https://badge.fury.io/rb/jbuilder.svg)][gem] [![Code Climate](https://codeclimate.com/github/rails/jbuilder/badges/gpa.svg)][codeclimate] -[travis]: https://travis-ci.org/rails/jbuilder +[test]: https://github.com/rails/jbuilder/actions?query=branch%3Amaster [gem]: https://rubygems.org/gems/jbuilder [codeclimate]: https://codeclimate.com/github/rails/jbuilder @@ -95,7 +95,7 @@ git push origin my-feature-branch -f #### Check on Your Pull Request -Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above. +Go back to your pull request after a few minutes and see whether it passed muster with GitHub Actions. Everything should look green, otherwise fix issues and amend your commit as described above. #### Be Patient diff --git a/Rakefile b/Rakefile index c51d882..3a28e6f 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,7 @@ require "bundler/setup" require "bundler/gem_tasks" require "rake/testtask" -if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"] +if !ENV["APPRAISAL_INITIALIZED"] && !ENV["CI"] require "appraisal/task" Appraisal::Task.new task default: :appraisal