Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit GitHub workflows #2301

Merged
merged 18 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
name: danger

on: pull_request

jobs:
danger:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
ruby-version: 2.7
bundler-cache: true
rubygems: latest
- 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
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- ruby: 2.7
gemfile: 'gemfiles/rails_edge.gemfile'
- ruby: 2.7
gemfile: 'gemfiles/rack_edge.gemfile'
- ruby: 2.7
gemfile: 'gemfiles/rack3.gemfile'
- ruby: "ruby-head"
- ruby: "truffleruby-head"
- ruby: "jruby-head"
ruby: ['2.7', '3.0', '3.1', '3.2', ruby-head, truffleruby-head, jruby-head]
gemfile: [rails_edge, rack_edge, rack_3_0]
runs-on: ubuntu-latest
continue-on-error: true
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v3

Expand Down
72 changes: 26 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,42 @@
---
name: test
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

on: [push, pull_request]

jobs:
lint:
name: RuboCop
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
rubygems: latest

- name: Run RuboCop
run: bundle exec rubocop

test:
strategy:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- "3.0"
gemfile:
- Gemfile
- gemfiles/rack1.gemfile
- gemfiles/rack2.gemfile
- gemfiles/rack2_2.gemfile
- gemfiles/rails_5.gemfile
- gemfiles/rails_6.gemfile
- gemfiles/rails_6_1.gemfile
ruby: ['2.7', '3.0', '3.1', '3.2']
gemfile: [rack_2_0, rails_6_0, rails_6_1, rails_7_0]
include:
- ruby: 3.1
gemfile: 'gemfiles/multi_json.gemfile'
- ruby: 3.1
gemfile: 'gemfiles/multi_xml.gemfile'
- ruby: 3.1
gemfile: 'gemfiles/rails_7.gemfile'
- ruby: "3.0"
gemfile: 'gemfiles/multi_json.gemfile'
- ruby: "3.0"
gemfile: 'gemfiles/multi_xml.gemfile'
- ruby: "3.0"
gemfile: 'gemfiles/rails_7.gemfile'
- ruby: 2.7
gemfile: 'gemfiles/multi_json.gemfile'
- ruby: 2.7
gemfile: 'gemfiles/multi_xml.gemfile'
- ruby: 2.7
gemfile: 'gemfiles/rails_7.gemfile'
runs-on: ubuntu-20.04
- ruby: '2.6'
gemfile: rails_5_2
- ruby: '2.7'
gemfile: rack_1_0
- ruby: '2.7'
gemfile: multi_json
- ruby: '2.7'
gemfile: multi_xml
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v3

Expand All @@ -67,20 +45,22 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: latest

- name: Run tests
run: bundle exec rake spec

- name: Run tests (spec/integration/eager_load)
if: ${{ matrix.gemfile == 'Gemfile' }}
# rack_2_0.gemfile is equals to Gemfile
if: ${{ matrix.gemfile == 'rack_2_0' }}
run: bundle exec rspec spec/integration/eager_load

- name: Run tests (spec/integration/multi_json)
if: ${{ matrix.gemfile == 'gemfiles/multi_json.gemfile' }}
if: ${{ matrix.gemfile == 'multi_json' }}
run: bundle exec rspec spec/integration/multi_json

- name: Run tests (spec/integration/multi_xml)
if: ${{ matrix.gemfile == 'gemfiles/multi_xml.gemfile' }}
if: ${{ matrix.gemfile == 'multi_xml' }}
run: bundle exec rspec spec/integration/multi_xml

- name: Coveralls
Expand All @@ -98,4 +78,4 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
parallel-finished: true
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [#2296](https://github.com/ruby-grape/grape/pull/2296): Fix cops and enables some - [@ericproulx](https://github.com/ericproulx).
* [#2302](https://github.com/ruby-grape/grape/pull/2302): Rack < 3 and update rack-test - [@ericproulx](https://github.com/ericproulx).
* [#2303](https://github.com/ruby-grape/grape/pull/2302): Rack >= 1.3.0 - [@ericproulx](https://github.com/ericproulx).
* [#2301](https://github.com/ruby-grape/grape/pull/2301): Revisit GH workflows - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

#### Fixes
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gemfiles/rack2_2.gemfile → gemfiles/rack_2_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

source 'https://rubygems.org'

gem 'rack', '~> 2.2'
gem 'rack', '~> 2.0'

group :development, :test do
gem 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rack2.gemfile → gemfiles/rack_3_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

source 'https://rubygems.org'

gem 'rack', '~> 2.0.0'
gem 'rack', '~> 3.0.0'

group :development, :test do
gem 'bundler'
Expand Down
File renamed without changes.
File renamed without changes.
46 changes: 0 additions & 46 deletions gemfiles/rails_7.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/rack3.gemfile → gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

source 'https://rubygems.org'

gem 'rack', '~> 3'
gem 'rails', '~> 7.0.0'

group :development, :test do
gem 'bundler'
Expand Down