diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 0000000..c643c4b --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,22 @@ +--- +name: danger +on: + pull_request: + types: [opened, reopened, edited, synchronize] +jobs: + danger: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Run Danger + run: | + # the personal token is public, this is ok, base64 encode to avoid tripping Github + TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) + DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7c6d5b3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: lint +on: [push, pull_request] +jobs: + rubocop: + name: RuboCop + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + - run: bundle exec rubocop + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ff43635 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +--- +name: test +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + entry: + - { ruby: '2.7', faraday: '0.9.0' } + - { ruby: '2.7', faraday: '0.17.0' } + - { ruby: '2.7', faraday: '~> 1.0' } + - { ruby: 'jruby-9.2.21.0' } + - { ruby: 'ruby-head', allowed-failure: true } + - { ruby: 'jruby-head', allowed-failure: true } + name: test (${{ matrix.entry.ruby }}, ${{ matrix.entry.faraday || 'default' }}) + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.entry.ruby }} + bundler-cache: true + - run: bundle exec rake test + continue-on-error: ${{ matrix.entry.allowed-failure || false }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 08402d5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: ruby - -sudo: false - -matrix: - include: - - rvm: 2.6.6 - env: FARADAY_VERSION=0.9.0 - - rvm: 2.6.6 - env: FARADAY_VERSION=0.17.0 - - rvm: 2.6.6 - env: FARADAY_VERSION="~> 1.0" - - rvm: 2.6.6 - script: - - bundle exec danger - - rvm: 2.3.8 - - rvm: jruby-9.2.7.0 - - rvm: jruby-head - - rvm: ruby-head - allow_failures: - - rvm: ruby-head - - rvm: jruby-head - -bundler_args: --without development diff --git a/CHANGELOG.md b/CHANGELOG.md index 5071185..533de78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 1.0.2 (Next) +* [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7358624..a4b627b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,7 +106,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 CI. Everything should look green, otherwise fix issues and amend your commit as described above. #### Be Patient diff --git a/Gemfile b/Gemfile index 23992ca..2b30dc4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,3 @@ -# NOTE: this is temporary until Bundler 2.0 changes how github: references work. -git_source(:github) { |repo| "https://github.com/#{repo['/'] ? repo : "#{repo}/#{repo}"}.git" } - source 'https://rubygems.org' gem 'faraday', ENV['FARADAY_VERSION'] if ENV.key?('FARADAY_VERSION') diff --git a/README.md b/README.md index 085e49d..69dfe6b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Hyperclient [![Gem Version](http://img.shields.io/gem/v/hyperclient.svg)](http://badge.fury.io/rb/hyperclient) -[![Build Status](http://img.shields.io/travis/codegram/hyperclient.svg)](https://travis-ci.org/codegram/hyperclient) +[![Build Status](https://github.com/codegram/hyperclient/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/codegram/hyperclient/actions/workflows/test.yml) [![Code Climate](https://codeclimate.com/github/codegram/hyperclient.svg)](https://codeclimate.com/github/codegram/hyperclient) [![Coverage Status](https://img.shields.io/coveralls/codegram/hyperclient.svg)](https://coveralls.io/r/codegram/hyperclient?branch=master) @@ -9,6 +9,8 @@ Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON # Table of Contents +- [Hyperclient](#hyperclient) +- [Table of Contents](#table-of-contents) - [Usage](#usage) - [API Client](#api-client) - [Resources and Attributes](#resources-and-attributes) diff --git a/RELEASING.md b/RELEASING.md index 4e16d1b..df10632 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -12,7 +12,7 @@ bundle install rake ``` -Check that the last build succeeded in [Travis CI](https://travis-ci.org/codegram/hyperclient) for all supported platforms. +Check that the last build succeeded in CI for all supported platforms. Increment the version, modify [lib/hyperclient/version.rb](lib/hyperclient/version.rb).