diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..022359e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +--- +name: CI +on: + push: + branches: + - main + pull_request: + schedule: + - cron: '15 3 * * 1' +jobs: + static-analysis: + name: 'Static analysis' + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: 'Set up Ruby' + uses: actions/setup-ruby@v1 + with: + ruby-version: '3.0.0' + - name: 'Check the environment' + run: | + ruby --version + gem --version + - name: 'Install bundler' + run: | + gem install bundler + bundle --version + - name: 'Install gems' + run: 'bundle install --jobs 4 --retry 3' + - name: 'Run RuboCop' + run: | + bundle exec rubocop Gemfile \ + gemfiles/Gemfile.rails-5.2 gemfiles/Gemfile.rails-6.0 \ + gemfiles/Gemfile.rails-6.1 lib/ test/ Rakefile + test: + name: "Tests: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}" + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: 'Set up Ruby' + uses: actions/setup-ruby@v1 + with: + ruby-version: '${{ matrix.ruby }}' + - name: 'Check the environment' + run: | + ruby --version + gem --version + - name: 'Install bundler' + run: | + gem install bundler + bundle --version + - name: 'Install gems' + env: + MATRIX_RAILS_VERSION: ${{ matrix.rails }} + run: | + export BUNDLE_GEMFILE="${GITHUB_WORKSPACE}/gemfiles/Gemfile.rails-${MATRIX_RAILS_VERSION}" + bundle install --jobs 4 --retry 3 + - name: 'Run the tests' + run: 'bundle exec rake --trace test' + strategy: + fail-fast: false + matrix: + ruby: + - '2.5.8' + - '2.6.6' + - '2.7.2' + rails: + - '5.2' + - '6.0' + - '6.1' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6abc391..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -os: linux - -dist: bionic - -language: ruby - -cache: bundler - -rvm: - - 2.5.8 - - 2.6.6 - - 2.7.2 - - ruby-head - -gemfile: - - Gemfile - - gemfiles/Gemfile.rails-5.2 - - gemfiles/Gemfile.rails-6.0 - - gemfiles/Gemfile.rails-6.1 - -install: - - bundle install - -script: - - bundle exec rake --trace test - - bundle exec rubocop Gemfile \ - gemfiles/Gemfile.rails-5.2 gemfiles/Gemfile.rails-6.0 \ - gemfiles/Gemfile.rails-6.1 lib/ test/ Rakefile - -jobs: - fast_finish: true diff --git a/README.md b/README.md index c88efaa..c74228f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Page title helper -[![Build Status](https://travis-ci.org/lwe/page_title_helper.svg?branch=master)](https://travis-ci.org/lwe/page_title_helper) +[![GitHub CI Status](https://github.com/lwe/page_title_helper/workflows/CI/badge.svg?branch=main)](https://github.com/lwe/page_title_helper/actions) [![Gem Version](https://badge.fury.io/rb/page_title_helper.svg)](https://badge.fury.io/rb/page_title_helper) This project adheres to [Semantic Versioning](https://semver.org/).