From 08b7f5790774d118e3150a7a4b5c24a5ea27a665 Mon Sep 17 00:00:00 2001 From: Ilya Bylich Date: Fri, 30 Oct 2020 16:09:16 +0300 Subject: [PATCH] migrate to github actions (#759) --- .github/workflows/test.yml | 47 +++++++++++++++++++++++++++++++++++++- .travis.yml | 41 --------------------------------- README.md | 2 +- ci/run_rubocop_specs | 3 +-- 4 files changed, 48 insertions(+), 45 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 606998048..69e83bb76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,51 @@ on: jobs: test: runs-on: ubuntu-latest + continue-on-error: ${{ matrix.allow_failure }} + env: + BUNDLE_JOBS: 4 + BUNDLE_RETRY: 3 + CI: true + TRUFFLERUBYOPT: "--engine.Mode=latency" + strategy: + fail-fast: false + matrix: + ruby: ["2.4.10", "2.5.8", "2.6.6", "2.7.2", "jruby-9.2"] + test_command: ["bundle exec rake test"] + allow_failure: [false] + include: + - ruby: "head" + test_command: "bundle exec rake test" + allow_failure: true + - ruby: "truffleruby" + test_command: "bundle exec rake test" + allow_failure: true + - ruby: "2.7.2" + test_command: "./ci/run_rubocop_specs" + allow_failure: true steps: - - name: succeed + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: /home/runner/bundle + key: bundle-${{ matrix.ruby }}-${{ hashFiles('../Gemfile') }}-${{ hashFiles('**/*.gemspec') }} + restore-keys: | + bundle-${{ matrix.ruby }}- + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install Ragel + run: | + sudo apt-get update + sudo apt-get install ragel + - name: Bundle install + run: | + bundle config path /home/runner/bundle + bundle install + bundle update + - name: Run tests + run: | + ${{ matrix.test_command }} + - name: ignore failure if the job is allowed to fail + if: ${{ matrix.allow_failure }} run: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index acd326d38..000000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -dist: trusty -language: ruby -jobs: - include: - - name: jruby-9.1.15.0 / Parser tests - rvm: jruby-9.1.15.0 - script: bundle exec rake test - - name: truffleruby / Parser tests - rvm: truffleruby - script: TRUFFLERUBYOPT=--engine.Mode=latency bundle exec rake test - - name: 2.4.10 / Parser tests - rvm: 2.4.10 - script: bundle exec rake test_cov - - name: 2.5.8 / Parser tests - rvm: 2.5.8 - script: bundle exec rake test_cov - - name: 2.6.6 / Parser tests - rvm: 2.6.6 - script: bundle exec rake test_cov - - name: 2.7.2 / Parser tests - rvm: 2.7.2 - script: bundle exec rake test_cov - - name: ruby-head / Parser tests - rvm: ruby-head - script: bundle exec rake test_cov - - name: 2.5.8 / Rubocop tests - rvm: 2.5.8 - script: ./ci/run_rubocop_specs - - name: 2.6.6 / Rubocop tests - rvm: 2.6.6 - script: ./ci/run_rubocop_specs - - name: 2.7.2 / Rubocop tests - rvm: 2.7.2 - script: ./ci/run_rubocop_specs - allow_failures: - - rvm: ruby-head - - rvm: truffleruby - - script: ./ci/run_rubocop_specs -before_install: - - bundle --version - - gem --version diff --git a/README.md b/README.md index 4a089161d..eb6bf3fed 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Parser [![Gem Version](https://badge.fury.io/rb/parser.svg)](https://badge.fury.io/rb/parser) -[![Build Status](https://travis-ci.org/whitequark/parser.svg?branch=master)](https://travis-ci.org/whitequark/parser) +[![Tests](https://github.com/whitequark/parser/workflows/Tests/badge.svg?branch=master)](https://github.com/whitequark/parser/actions?query=workflow%3ATests+branch%3Amaster) _Parser_ is a production-ready Ruby parser written in pure Ruby. It recognizes as much or more code than Ripper, Melbourne, JRubyParser or ruby\_parser, and diff --git a/ci/run_rubocop_specs b/ci/run_rubocop_specs index 456ce2c60..92ecbcabd 100755 --- a/ci/run_rubocop_specs +++ b/ci/run_rubocop_specs @@ -2,8 +2,7 @@ set -eux -bundle install -rake generate +bundle exec rake generate git clone https://github.com/rubocop-hq/rubocop.git --depth=1 cd rubocop