Skip to content

Commit 32cd6b2

Browse files
authored
CI: Simplify ruby.yml workflow (#3159)
* build: Reformat YAML in Ruby CI Workflow The "quoted 3.0" is about Floats in YAML risking becoming the string "3" for interpolation. The GitHub UI for editing this file didn't like the formatting of lists in the old way, so I picked a YAML list format which also allows easy add/remove lines. The "exclude:" directive no longer includes unused Ruby v2.4 entries. * build: Use setup-ruby's "bundler-cache: true" * build: Drop unused Node.js from Ruby CI Workflow
1 parent 2bdcdb1 commit 32cd6b2

File tree

1 file changed

+13
-41
lines changed

1 file changed

+13
-41
lines changed

.github/workflows/ruby.yml

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,42 @@ jobs:
77
name: Ruby specs
88
runs-on: ${{ matrix.os }}
99
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' || matrix.experimental }}
10-
env:
11-
BUNDLE_JOBS: 4
12-
BUNDLE_RETRY: 3
1310
strategy:
1411
fail-fast: false
1512
matrix:
1613
os: [ubuntu-latest]
17-
node: [14]
18-
ruby: [
19-
2.7,
20-
3.0
21-
]
22-
gemfile: [
23-
"gemfiles/Gemfile-rails.5.2.x",
24-
"gemfiles/Gemfile-rails.6.0.x",
25-
"gemfiles/Gemfile-rails.6.1.x"
26-
]
14+
ruby:
15+
- 2.7
16+
- "3.0"
17+
gemfile:
18+
- gemfiles/Gemfile-rails.5.2.x
19+
- gemfiles/Gemfile-rails.6.0.x
20+
- gemfiles/Gemfile-rails.6.1.x
2721
exclude:
28-
- ruby: 2.4
29-
gemfile: gemfiles/Gemfile-rails.6.0.x
30-
- ruby: 2.4
31-
gemfile: gemfiles/Gemfile-rails.6.1.x
3222
- ruby: 2.5
3323
gemfile: gemfiles/Gemfile-rails.6.1.x
34-
- ruby: 3.0
24+
- ruby: "3.0"
3525
gemfile: gemfiles/Gemfile-rails.5.2.x
3626
experimental: [false]
3727
include:
3828
- ruby: 2.7
3929
os: ubuntu-latest
4030
gemfile: gemfiles/Gemfile-rails-edge
4131
experimental: true
42-
- ruby: 3.0
32+
- ruby: "3.0"
4333
os: ubuntu-latest
4434
gemfile: gemfiles/Gemfile-rails-edge
4535
experimental: true
4636

37+
env:
38+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
4739
steps:
4840
- uses: actions/checkout@v2
49-
- uses: actions/cache@v2
50-
with:
51-
path: /home/runner/bundle
52-
key: bundle-use-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-gems-${{ hashFiles(matrix.gemfile) }}-${{ hashFiles('**/*.gemspec') }}
53-
restore-keys: |
54-
bundle-use-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-gems-
55-
56-
- name: Use Node.js ${{ matrix.node }}
57-
uses: actions/setup-node@v1
58-
with:
59-
node-version: ${{ matrix.node }}
60-
61-
- name: Install yarn maybe
62-
run: which yarn || npm install -g yarn
6341

6442
- uses: ruby/setup-ruby@v1
6543
with:
6644
ruby-version: ${{ matrix.ruby }}
67-
68-
- name: Bundle install
69-
run: |
70-
gem install bundler -v 2.1.4
71-
bundle config path /home/runner/bundle
72-
bundle config --global gemfile ${{ matrix.gemfile }}
73-
bundle install --jobs 4 --retry 3
45+
bundler-cache: true # Run "bundle install", and cache the result automatically.
7446

7547
- name: Ruby specs
76-
run: bundle exec rake test
48+
run: bundle exec rake

0 commit comments

Comments
 (0)