Skip to content

Commit af001af

Browse files
authored
Merge pull request #35 from fastruby/fixes/test-suite-for-ruby-2-6
Improve our test workflow
2 parents 90277fd + 25d2059 commit af001af

2 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/test.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,38 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
ruby-version: ["2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
16+
include:
17+
- ruby-version: "2.5"
18+
bundler-version: "2.3.27"
19+
- ruby-version: "2.6"
20+
bundler-version: "2.4.0"
21+
- ruby-version: "2.7"
22+
bundler-version: "2.4.0"
23+
- ruby-version: "3.0"
24+
- ruby-version: "3.1"
25+
- ruby-version: "3.2"
26+
- ruby-version: "3.3"
27+
- ruby-version: "3.4"
1728

1829
steps:
19-
- uses: actions/checkout@v1
30+
- uses: actions/checkout@v4
2031
- name: Setup Ruby
2132
uses: ruby/setup-ruby@v1
2233
with:
2334
ruby-version: ${{ matrix.ruby-version }}
24-
bundler-cache: true
25-
- name: Uninstall existing Bundler
26-
run: |
27-
gem uninstall bundler -a -x || true
35+
# Disable bundler-cache when a custom bundler version is required,
36+
# as setup-ruby's cache is tied to the bundler it installs.
37+
bundler-cache: ${{ !matrix.bundler-version }}
2838
- name: Install Bundler
29-
run: |
30-
if [[ "${{ matrix.ruby-version }}" == "2.5" ]]; then
31-
gem install bundler -v "~> 2.3.27"
32-
elif [[ "${{ matrix.ruby-version }}" == "2.6" || "${{ matrix.ruby-version }}" == "2.7" ]]; then
33-
gem install bundler -v "~> 2.4.0"
34-
fi
39+
if: matrix.bundler-version
40+
run: gem install bundler -v "~> ${{ matrix.bundler-version }}"
41+
- name: Install gems
42+
if: matrix.bundler-version
43+
run: bundle install
3544
- name: Build and run tests
3645
env:
3746
COVERAGE: true
47+
# TERM is required for colored/formatted test output in CI
3848
TERM: xterm
3949
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40-
run: |
41-
bundle exec rake test
50+
run: bundle exec rake test

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# main ([unreleased](https://github.com/fastruby/rails_stats/compare/v1.0.2...main))
22

3+
* [CHORE: Improve the GH Test Workflow](https://github.com/fastruby/rails_stats/pull/35)
34
* [BUGFIX: Fix JSON output missing Code and Tests total count](https://github.com/fastruby/rails_stats/pull/40)
45
* Update README examples
56
* [FEATURE: Output number of tables created from schema.rb or structure.sql, add polymorphic models count](https://github.com/fastruby/rails_stats/pull/37)
@@ -25,4 +26,4 @@
2526
# v1.0.1 / 2018-10-8
2627

2728
* [FEATURE: add more aggregate stats](https://github.com/fastruby/rails_stats/pull/5)
28-
* [FEATURE: More detailed introspection of app](https://github.com/fastruby/rails_stats/pull/1)
29+
* [FEATURE: More detailed introspection of app](https://github.com/fastruby/rails_stats/pull/1)

0 commit comments

Comments
 (0)