Skip to content

Commit cdeaa13

Browse files
authored
Revisit GitHub workflows (#2301)
* Rename gemfiles to follow standard * Use ubuntu-latest Refactor ruby-matrix on test and edge Add rubygems: latest Add 3.2 * Fix typo * Remove rack_3_0.gemfile * Exclude ruby 2.6 for rails_7_0 * Add entry CHANGELOG.md * Remove spaces in arrays Add rubygems in danger.yml * Include [Rails 5.2, Ruby 2.6] Exclude [Rails 7.0, Ruby 2.6] * Fix test.yml * Only exclude * Lock rails_7_0 to not include 7.1 Lock rack_3_0 to not include 3.1 Remove rack_2_2 in favor of 2_0 to test Rename rack3 to rack_3_0 Testing workflow include/exclude * testing ruby matrix '2.7', '3.0', '3.1', '3.2' testing gemfile rack_2_0, rails_6_0, rails_6_1, rails_7_0 include 2.6 for rails_5_2 include 2.7 for rack_1_0, multi_json, multi_xml * Fix integration and eager_load * Try fixing test.yml * Danger now on 2.7 Remove matrix os in edge Add rubygems: latest to rubocop
1 parent c8b755d commit cdeaa13

11 files changed

+36
-110
lines changed

.github/workflows/danger.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
22
name: danger
3-
43
on: pull_request
54

65
jobs:
76
danger:
8-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
98
steps:
109
- uses: actions/checkout@v3
1110
with:
1211
fetch-depth: 100
1312
- name: Set up Ruby
1413
uses: ruby/setup-ruby@v1
1514
with:
16-
ruby-version: 2.6
15+
ruby-version: 2.7
1716
bundler-cache: true
17+
rubygems: latest
1818
- name: Run Danger
1919
run: |
2020
# the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok

.github/workflows/edge.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,12 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
include:
10-
- ruby: 2.7
11-
gemfile: 'gemfiles/rails_edge.gemfile'
12-
- ruby: 2.7
13-
gemfile: 'gemfiles/rack_edge.gemfile'
14-
- ruby: 2.7
15-
gemfile: 'gemfiles/rack3.gemfile'
16-
- ruby: "ruby-head"
17-
- ruby: "truffleruby-head"
18-
- ruby: "jruby-head"
9+
ruby: ['2.7', '3.0', '3.1', '3.2', ruby-head, truffleruby-head, jruby-head]
10+
gemfile: [rails_edge, rack_edge, rack_3_0]
1911
runs-on: ubuntu-latest
2012
continue-on-error: true
2113
env:
22-
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
23-
14+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
2415
steps:
2516
- uses: actions/checkout@v3
2617

.github/workflows/test.yml

+26-46
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,42 @@
1-
---
21
name: test
3-
on:
4-
push:
5-
branches:
6-
- "*"
7-
pull_request:
8-
branches:
9-
- "*"
2+
3+
on: [push, pull_request]
4+
105
jobs:
116
lint:
127
name: RuboCop
13-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-latest
149
steps:
1510
- uses: actions/checkout@v3
11+
1612
- name: Set up Ruby
1713
uses: ruby/setup-ruby@v1
1814
with:
1915
ruby-version: 2.7
2016
bundler-cache: true
17+
rubygems: latest
18+
2119
- name: Run RuboCop
2220
run: bundle exec rubocop
21+
2322
test:
2423
strategy:
2524
fail-fast: false
2625
matrix:
27-
ruby:
28-
- 2.6
29-
- 2.7
30-
- "3.0"
31-
gemfile:
32-
- Gemfile
33-
- gemfiles/rack1.gemfile
34-
- gemfiles/rack2.gemfile
35-
- gemfiles/rack2_2.gemfile
36-
- gemfiles/rails_5.gemfile
37-
- gemfiles/rails_6.gemfile
38-
- gemfiles/rails_6_1.gemfile
26+
ruby: ['2.7', '3.0', '3.1', '3.2']
27+
gemfile: [rack_2_0, rails_6_0, rails_6_1, rails_7_0]
3928
include:
40-
- ruby: 3.1
41-
gemfile: 'gemfiles/multi_json.gemfile'
42-
- ruby: 3.1
43-
gemfile: 'gemfiles/multi_xml.gemfile'
44-
- ruby: 3.1
45-
gemfile: 'gemfiles/rails_7.gemfile'
46-
- ruby: "3.0"
47-
gemfile: 'gemfiles/multi_json.gemfile'
48-
- ruby: "3.0"
49-
gemfile: 'gemfiles/multi_xml.gemfile'
50-
- ruby: "3.0"
51-
gemfile: 'gemfiles/rails_7.gemfile'
52-
- ruby: 2.7
53-
gemfile: 'gemfiles/multi_json.gemfile'
54-
- ruby: 2.7
55-
gemfile: 'gemfiles/multi_xml.gemfile'
56-
- ruby: 2.7
57-
gemfile: 'gemfiles/rails_7.gemfile'
58-
runs-on: ubuntu-20.04
29+
- ruby: '2.6'
30+
gemfile: rails_5_2
31+
- ruby: '2.7'
32+
gemfile: rack_1_0
33+
- ruby: '2.7'
34+
gemfile: multi_json
35+
- ruby: '2.7'
36+
gemfile: multi_xml
37+
runs-on: ubuntu-latest
5938
env:
60-
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
61-
39+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
6240
steps:
6341
- uses: actions/checkout@v3
6442

@@ -67,20 +45,22 @@ jobs:
6745
with:
6846
ruby-version: ${{ matrix.ruby }}
6947
bundler-cache: true
48+
rubygems: latest
7049

7150
- name: Run tests
7251
run: bundle exec rake spec
7352

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

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

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

8666
- name: Coveralls
@@ -98,4 +78,4 @@ jobs:
9878
uses: coverallsapp/github-action@master
9979
with:
10080
github-token: ${{ secrets.github_token }}
101-
parallel-finished: true
81+
parallel-finished: true

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [#2296](https://github.com/ruby-grape/grape/pull/2296): Fix cops and enables some - [@ericproulx](https://github.com/ericproulx).
88
* [#2302](https://github.com/ruby-grape/grape/pull/2302): Rack < 3 and update rack-test - [@ericproulx](https://github.com/ericproulx).
99
* [#2303](https://github.com/ruby-grape/grape/pull/2302): Rack >= 1.3.0 - [@ericproulx](https://github.com/ericproulx).
10+
* [#2301](https://github.com/ruby-grape/grape/pull/2301): Revisit GH workflows - [@ericproulx](https://github.com/ericproulx).
1011
* Your contribution here.
1112

1213
#### Fixes
File renamed without changes.

gemfiles/rack2_2.gemfile renamed to gemfiles/rack_2_0.gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
source 'https://rubygems.org'
66

7-
gem 'rack', '~> 2.2'
7+
gem 'rack', '~> 2.0'
88

99
group :development, :test do
1010
gem 'bundler'

gemfiles/rack2.gemfile renamed to gemfiles/rack_3_0.gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
source 'https://rubygems.org'
66

7-
gem 'rack', '~> 2.0.0'
7+
gem 'rack', '~> 3.0.0'
88

99
group :development, :test do
1010
gem 'bundler'
File renamed without changes.
File renamed without changes.

gemfiles/rails_7.gemfile

-46
This file was deleted.

gemfiles/rack3.gemfile renamed to gemfiles/rails_7_0.gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
source 'https://rubygems.org'
66

7-
gem 'rack', '~> 3'
7+
gem 'rails', '~> 7.0.0'
88

99
group :development, :test do
1010
gem 'bundler'

0 commit comments

Comments
 (0)