Skip to content

Commit abd97fb

Browse files
committed
Refactor code with matrix
1 parent 5222fe8 commit abd97fb

File tree

1 file changed

+5
-59
lines changed

1 file changed

+5
-59
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ on:
99
branches:
1010
- main
1111
jobs:
12-
test-ruby-2-5-x:
12+
test:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
ruby-version: ["2.5", "2.6", "2.7", "3.0"]
1417

1518
steps:
1619
- uses: actions/checkout@v1
1720
- name: Setup Ruby
1821
uses: ruby/setup-ruby@v1
1922
with:
20-
ruby-version: 2.5
23+
ruby-version: ${{ matrix.ruby-version }}
2124
bundler-cache: true
2225
- name: Build and run tests
2326
env:
@@ -28,60 +31,3 @@ jobs:
2831
gem install bundler
2932
bundle install --jobs 4 --retry 3
3033
bundle exec rake test
31-
test-ruby-2-6-x:
32-
runs-on: ubuntu-latest
33-
34-
steps:
35-
- uses: actions/checkout@v1
36-
- name: Setup Ruby
37-
uses: ruby/setup-ruby@v1
38-
with:
39-
ruby-version: 2.6
40-
bundler-cache: true
41-
- name: Build and run tests
42-
env:
43-
COVERAGE: true
44-
TERM: xterm
45-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
46-
run: |
47-
gem install bundler
48-
bundle install --jobs 4 --retry 3
49-
bundle exec rake test
50-
test-ruby-2-7-x:
51-
runs-on: ubuntu-latest
52-
53-
steps:
54-
- uses: actions/checkout@v1
55-
- name: Setup Ruby
56-
uses: ruby/setup-ruby@v1
57-
with:
58-
ruby-version: 2.7
59-
bundler-cache: true
60-
- name: Build and run tests
61-
env:
62-
COVERAGE: true
63-
TERM: xterm
64-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
65-
run: |
66-
gem install bundler
67-
bundle install --jobs 4 --retry 3
68-
bundle exec rake test
69-
test-ruby-3-0-x:
70-
runs-on: ubuntu-latest
71-
72-
steps:
73-
- uses: actions/checkout@v1
74-
- name: Setup Ruby
75-
uses: ruby/setup-ruby@v1
76-
with:
77-
ruby-version: 3.0
78-
bundler-cache: true
79-
- name: Build and run tests
80-
env:
81-
COVERAGE: true
82-
TERM: xterm
83-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
84-
run: |
85-
gem install bundler
86-
bundle install --jobs 4 --retry 3
87-
bundle exec rake test

0 commit comments

Comments
 (0)