diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 0000000..0d2fc72 --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,21 @@ +name: Danger +on: + push: + branches: + - master + pull_request: +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "2.5.6" + bundler-cache: true + - name: Run Danger + run: | + # the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok + TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode) + DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..efca370 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Tests +on: + push: + branches: + - master + pull_request: +jobs: + test: + runs-on: ubuntu-latest + continue-on-error: ${{ (matrix.grape-swagger.experimental) || (matrix.ruby.experimental) }} + strategy: + fail-fast: false + matrix: + grape-swagger: + - { version: "0.8.0", experimental: false } + - { version: "0.9.0", experimental: false } + - { version: "0.11.0", experimental: false } + - { version: "0.20.2", experimental: false } + - { version: "0.33.0", experimental: false } + - { version: "HEAD", experimental: true } + ruby: + - { version: "2.5.6", experimental: false } + - { version: "ruby-head", experimental: true } + - { version: "jruby-head", experimental: true } + env: + GRAPE_SWAGGER_VERSION: ${{ matrix.grape-swagger.version }} + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby.version }} + bundler-cache: true + - name: Setup Firefox + uses: browser-actions/setup-firefox@v1 + with: + firefox-version: "54.0" + - uses: browser-actions/setup-geckodriver@latest + with: + geckodriver-version: "0.18.0" + - uses: GabrielBB/xvfb-action@v1 + with: + run: bundle exec rake spec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 90421da..0000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -addons: - firefox: 54.0 - -services: - - xvfb - -before_install: - - wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz - - mkdir geckodriver - - tar -xzf geckodriver-v0.18.0-linux64.tar.gz -C geckodriver - - export PATH=$PATH:$PWD/geckodriver - -language: ruby - -cache: bundler - -matrix: - include: - - rvm: 2.5.6 - script: - - bundle exec danger - - rvm: 2.5.6 - env: - - GRAPE_SWAGGER_VERSION=0.8.0 - - rvm: 2.5.6 - env: - - GRAPE_SWAGGER_VERSION=0.9.0 - - rvm: 2.5.6 - env: - - GRAPE_SWAGGER_VERSION=0.11.0 - - rvm: 2.5.6 - env: - - GRAPE_SWAGGER_VERSION=0.20.2 - - rvm: 2.5.6 - env: - - GRAPE_SWAGGER_VERSION=0.33.0 - - rvm: 2.5.6 - env: - - GRAPE_SWAGGER_VERSION=HEAD - - rvm: ruby-head - - rvm: jruby-head - allow_failures: - - env: GRAPE_SWAGGER_VERSION=HEAD - - rvm: ruby-head - - rvm: jruby-head diff --git a/CHANGELOG.md b/CHANGELOG.md index 66581e7..cd39892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Next Release +* [#105](https://github.com/ruby-grape/grape-swagger-rails/pull/105): Migrate to GitHub Actions - [@duffn](https://github.com/duffn). * [#98](https://github.com/ruby-grape/grape-swagger-rails/pull/98): Fix: test against Rails 6 - [@dblock](https://github.com/dblock). * Your contribution here. diff --git a/Gemfile b/Gemfile index 8d6cf17..020e25e 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ else end group :development, :test do - gem 'ruby-grape-danger', '~> 0.1.0', require: false + gem 'ruby-grape-danger', '~> 0.2.0', require: false gem 'rake' gem 'rspec-rails' gem 'capybara' diff --git a/README.md b/README.md index ee31cf3..46b168f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GrapeSwaggerRails [![Gem Version](https://badge.fury.io/rb/grape-swagger-rails.svg)](http://badge.fury.io/rb/grape-swagger-rails) -[![Build Status](https://travis-ci.org/ruby-grape/grape-swagger-rails.svg)](https://travis-ci.org/ruby-grape/grape-swagger-rails) +[![Test](https://github.com/ruby-grape/grape-swagger-rails/workflows/test/badge.svg?branch=master)](https://github.com/ruby-grape/grape-swagger-rails/actions) [![Code Climate](https://codeclimate.com/github/ruby-grape/grape-swagger-rails/badges/gpa.svg)](https://codeclimate.com/github/ruby-grape/grape-swagger-rails) Swagger UI as Rails Engine for grape-swagger gem.