From b5522b749e122f94dfaa376294acd9cb7264479b Mon Sep 17 00:00:00 2001 From: Ville Lautanala Date: Fri, 1 Jan 2021 15:18:42 +0200 Subject: [PATCH] Run tests on GitHub Actions Travis CI does not offer free minutes for open source projects. GitHub Actions ha sbetter integration with GitHub. Migrating does require dropping Ruby 1.9 and 2.0 from CI matrix, but these have not been maintained for years now. --- .github/workflows/ruby.yml | 41 +++++++++++++++++++++++++++++++++-- .travis.yml | 44 -------------------------------------- README.md | 2 -- spec/spec_helper.rb | 2 +- 4 files changed, 40 insertions(+), 49 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0c810aa..a436820 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,8 +1,45 @@ -name: Ruby +name: CI -on: [push] +on: [push, pull_request] jobs: + test: + name: >- + Test (${{ matrix.ruby }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + gemfile: [Gemfile] + ruby: + - "2.1" + - "2.2" + - "2.3" + - "2.4" + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - jruby + - truffleruby + include: + - ruby: 2.5 + gemfile: gemfiles/rubyracer + - ruby: jruby + gemfile: gemfiles/rubyrhino + - ruby: 2.5 + gemfile: gemfiles/alaska + alaska: 1 + env: + BUNDLE_GEMFILE: ${{ matrix.gemfile }} + ALASKA: ${{ matrix.alaska}} + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake spec lint: runs-on: ubuntu-latest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3e1cb6d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -sudo: false -language: ruby -cache: bundler -rvm: - - 1.9 - - 2.0 - - 2.1 - - 2.2 - - 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - ruby-head - - jruby-head - - jruby-9.2.9.0 - - truffleruby -before_install: - - gem install bundler -v 1.17.3 -git: - submodules: false -gemfile: - - Gemfile -matrix: - include: - - rvm: 2.5 - gemfile: gemfiles/rubyracer - - rvm: jruby-9.2.9.0 - gemfile: gemfiles/rubyrhino - - rvm: jruby-head - gemfile: gemfiles/rubyrhino - - rvm: 2.5 - gemfile: gemfiles/alaska - env: ALASKA=1 - allow_failures: - - rvm: 2.5 - gemfile: gemfiles/alaska - env: ALASKA=1 - - rvm: ruby-head - - rvm: truffleruby - - rvm: jruby-head - - rvm: jruby-head - gemfile: gemfiles/rubyrhino - fast_finish: true diff --git a/README.md b/README.md index a262f2d..f1a6dd3 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ UglifyJS currently is extensively tested with ES5, but also includes experimenta More stable alternatives for working with ES6 code is to first transpile to ES5 with e.g. [babel-transpiler](https://github.com/babel/ruby-babel-transpiler) or using [Closure Compiler](https://github.com/documentcloud/closure-compiler) to directly minify ES6 code. -[![Build Status](https://travis-ci.org/lautis/uglifier.svg?branch=master)](https://travis-ci.org/lautis/uglifier) - ## ES6 / ES2015+ / Harmony mode When using Uglifier with ES6 syntax without any options, an error will be diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3b9aa29..b4f3df7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,7 @@ # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } -if ENV["ALASKA"] +if ENV["ALASKA"] == "1" require 'alaska/runtime' require 'tempfile' ExecJS.runtime = Alaska::Runtime.new