@@ -4,103 +4,39 @@ name: Test
4
4
on :
5
5
push :
6
6
branches :
7
- - main
7
+ - main
8
8
pull_request :
9
9
branches :
10
- - main
10
+ - main
11
11
jobs :
12
- test-ruby-2-4-x :
12
+ test :
13
13
runs-on : ubuntu-latest
14
+ strategy :
15
+ matrix :
16
+ ruby-version : ["2.5", "2.6", "2.7", "3.0"]
14
17
15
18
steps :
16
19
- uses : actions/checkout@v1
17
20
- name : Setup Ruby
18
21
uses : ruby/setup-ruby@v1
19
22
with :
20
- ruby-version : 2.4
23
+ ruby-version : ${{ matrix.ruby-version }}
21
24
bundler-cache : true
22
- - name : Build and run tests
23
- env :
24
- COVERAGE : true
25
- TERM : xterm
26
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
27
- run : |
28
- gem install bundler
29
- bundle install --jobs 4 --retry 3
30
- bundle exec rake test
31
- test-ruby-2-5-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.5
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-6-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.6
59
- bundler-cache : true
60
- - name : Build and run tests
61
- env :
62
- COVERAGE : true
63
- TERM : xterm
64
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
25
+ - name : Uninstall existing Bundler
65
26
run : |
66
- gem install bundler
67
- bundle install --jobs 4 --retry 3
68
- bundle exec rake test
69
- test-ruby-2-7-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 : 2.7
78
- bundler-cache : true
79
- - name : Build and run tests
80
- env :
81
- COVERAGE : true
82
- TERM : xterm
83
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
27
+ gem uninstall bundler -a -x || true
28
+ - name : Install Bundler
84
29
run : |
85
- gem install bundler
86
- bundle install --jobs 4 --retry 3
87
- bundle exec rake test
88
- test-ruby-3-0-x :
89
- runs-on : ubuntu-latest
90
-
91
- steps :
92
- - uses : actions/checkout@v1
93
- - name : Setup Ruby
94
- uses : ruby/setup-ruby@v1
95
- with :
96
- ruby-version : 3.0
97
- bundler-cache : true
30
+ if [[ "${{ matrix.ruby-version }}" == "2.6" || "${{ matrix.ruby-version }}" == "2.7" ]]; then
31
+ gem install bundler -v "~> 2.4.0"
32
+ else
33
+ gem install bundler
34
+ fi
98
35
- name : Build and run tests
99
36
env :
100
37
COVERAGE : true
101
38
TERM : xterm
102
39
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
103
40
run : |
104
- gem install bundler
105
41
bundle install --jobs 4 --retry 3
106
42
bundle exec rake test
0 commit comments