@@ -4,103 +4,39 @@ name: Test
44on :
55 push :
66 branches :
7- - main
7+ - main
88 pull_request :
99 branches :
10- - main
10+ - main
1111jobs :
12- test-ruby-2-4-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.4
23+ ruby-version : ${{ matrix.ruby-version }}
2124 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
6526 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
8429 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
9835 - name : Build and run tests
9936 env :
10037 COVERAGE : true
10138 TERM : xterm
10239 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
10340 run : |
104- gem install bundler
10541 bundle install --jobs 4 --retry 3
10642 bundle exec rake test
0 commit comments