diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..24baefc6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,29 @@ +name: Lint +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + overcommit: + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + + - name: Prepare environment + run: | + git config --local user.email "gh-actions@example.com" + git config --local user.name "GitHub Actions" + bundle exec overcommit --sign + + - name: Run pre-commit checks + run: bundle exec overcommit --run diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..91ddb5b9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,52 @@ +name: Tests +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + rspec: + timeout-minutes: 10 + runs-on: ${{ matrix.os }}-latest + + strategy: + matrix: + ruby-version: + - '2.6' + - '2.7' + - '3.0' + - '3.1' + os: + - ubuntu + - windows + + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + + - name: Run tests + run: bundle exec rspec + + - name: Code coverage reporting + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: ruby${{ matrix.ruby-version }}-${{ matrix.os }} + parallel: true + + finish: + needs: rspec + runs-on: ubuntu-latest + + steps: + - name: Finalize code coverage report + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7b489462..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: ruby - -cache: bundler - -rvm: - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - 3.0 - -before_script: - - git config --global user.email "travis@travis.ci" - - git config --global user.name "Travis CI" - -before_install: - - gem update --system - - gem install bundler - -script: - - bundle exec rspec - - bundle exec overcommit --sign - - bundle exec overcommit --sign pre-commit - - bundle exec overcommit --run diff --git a/README.md b/README.md index 36126a2c..0464e604 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![Gem Version](https://badge.fury.io/rb/overcommit.svg)](https://badge.fury.io/rb/overcommit) -[![Build Status](https://travis-ci.org/sds/overcommit.svg?branch=master)](https://travis-ci.org/sds/overcommit) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/umui038jlm597ryf?svg=true)](https://ci.appveyor.com/project/sds/overcommit) +[![Build Status](https://github.com/sds/overcommit/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/sds/overcommit/actions/workflows/tests.yml/badge.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/sds/overcommit/badge.svg?branch=master)](https://coveralls.io/github/sds/overcommit?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/5da42f7f365e5fef6b4c/maintainability)](https://codeclimate.com/github/sds/overcommit/maintainability) [![Inline docs](http://inch-ci.org/github/sds/overcommit.svg?branch=master)](http://inch-ci.org/github/sds/overcommit)