Skip to content

Commit b2a156d

Browse files

22 files changed

+416
-22
lines changed

.github/workflows/ancient.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Ancient Compat (EOL, Ruby 2.5) Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: "${{ github.workflow }}-${{ github.ref }}"
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
24+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
runs-on: ubuntu-22.04
26+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
27+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
28+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
# Ruby 2.3
34+
- ruby: "2.3"
35+
appraisal: "ruby-2-3"
36+
exec_cmd: "rake rspec"
37+
gemfile: "Appraisal.root"
38+
rubygems: "3.3.27"
39+
bundler: "2.3.27"
40+
41+
# Ruby 2.4
42+
- ruby: "2.4"
43+
appraisal: "ruby-2-4"
44+
exec_cmd: "rake rspec"
45+
gemfile: "Appraisal.root"
46+
rubygems: "3.3.27"
47+
bundler: "2.3.27"
48+
49+
# Ruby 2.5
50+
- ruby: "2.5"
51+
appraisal: "ruby-2-5"
52+
exec_cmd: "rake rspec"
53+
gemfile: "Appraisal.root"
54+
rubygems: "3.3.27"
55+
bundler: "2.3.27"
56+
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Setup Ruby & RubyGems
62+
uses: ruby/setup-ruby@v1
63+
with:
64+
ruby-version: ${{ matrix.ruby }}
65+
rubygems: ${{ matrix.rubygems }}
66+
bundler: ${{ matrix.bundler }}
67+
bundler-cache: false
68+
69+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
70+
# We need to do this first to get appraisal installed.
71+
# NOTE: This does not use the main Gemfile at all.
72+
- name: Bundle install for Appraisal ${{ matrix.appraisal }}
73+
run: bundle
74+
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
75+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
76+
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }}
77+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/hoary.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Hoary Compat (EOL, Ruby 2.2) Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: "${{ github.workflow }}-${{ github.ref }}"
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
24+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
runs-on: ubuntu-22.04
26+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
27+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
28+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
# Ruby 2.2
34+
- ruby: "2.2"
35+
appraisal: "ruby-2-2"
36+
exec_cmd: "rake rspec"
37+
gemfile: "Appraisal.root"
38+
rubygems: "2.7.11"
39+
bundler: "1.17.3"
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Setup Ruby & RubyGems
46+
uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby }}
49+
rubygems: ${{ matrix.rubygems }}
50+
bundler: ${{ matrix.bundler }}
51+
bundler-cache: false
52+
53+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
54+
# We need to do this first to get appraisal installed.
55+
# NOTE: This does not use the main Gemfile at all.
56+
- name: Bundle install for Appraisal ${{ matrix.appraisal }}
57+
run: bundle
58+
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
59+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
60+
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }}
61+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

Appraisal.hoary.gemfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
2+
3+
source "https://rubygems.org"
4+
5+
# Appraisal Root Gemfile is for running appraisal to generate the Appraisal Gemfiles
6+
# in gemfiles/*gemfile.
7+
# On CI, we use it for the Appraisal-based builds.
8+
# We do not load the standard Gemfile, as it is tailored for local development.
9+
10+
gemspec
11+
12+
gem "appraisal", "~> 2.2.0" # Last version to support Ruby v1.8 - v2.2

Appraisal.root.gemfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
2+
3+
source "https://rubygems.org"
4+
5+
# Appraisal Root Gemfile is for running appraisal to generate the Appraisal Gemfiles
6+
# in gemfiles/*gemfile.
7+
# On CI, we use it for the Appraisal-based builds.
8+
# We do not load the standard Gemfile, as it is tailored for local development.
9+
10+
gemspec
11+
12+
gem "appraisal", github: "pboling/appraisal", branch: "eval_gemfile"

Appraisals

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# frozen_string_literal: true
2+
3+
appraise "ruby-2-3" do
4+
gem "mutex_m", "~> 0.2"
5+
gem "stringio", "~> 3.0"
6+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
7+
end
8+
9+
appraise "ruby-2-4" do
10+
gem "mutex_m", "~> 0.2"
11+
gem "stringio", "~> 3.0"
12+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
13+
end
14+
15+
appraise "ruby-2-5" do
16+
gem "mutex_m", "~> 0.2"
17+
gem "stringio", "~> 3.0"
18+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
19+
end
20+
21+
appraise "ruby-2-6" do
22+
gem "mutex_m", "~> 0.2"
23+
gem "stringio", "~> 3.0"
24+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
25+
end
26+
27+
appraise "ruby-2-7" do
28+
gem "mutex_m", "~> 0.2"
29+
gem "stringio", "~> 3.0"
30+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
31+
end
32+
33+
appraise "ruby-3-0" do
34+
gem "mutex_m", "~> 0.2"
35+
gem "stringio", "~> 3.0"
36+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
37+
end
38+
39+
appraise "ruby-3-1" do
40+
gem "mutex_m", "~> 0.2"
41+
gem "stringio", "~> 3.0"
42+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
43+
end
44+
45+
appraise "ruby-3-2" do
46+
gem "mutex_m", "~> 0.2"
47+
gem "stringio", "~> 3.0"
48+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
49+
end
50+
51+
appraise "ruby-3-3" do
52+
gem "mutex_m", "~> 0.2"
53+
gem "stringio", "~> 3.0"
54+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
55+
end
56+
57+
appraise "ruby-3-4" do
58+
gem "mutex_m", "~> 0.2"
59+
gem "stringio", "~> 3.0"
60+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
61+
end
62+
63+
# Only run security audit on latest Ruby version
64+
appraise "audit" do
65+
gem "mutex_m", "~> 0.2"
66+
gem "stringio", "~> 3.0"
67+
eval_gemfile "modular/audit.gemfile"
68+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
69+
end
70+
71+
# Only run coverage on latest Ruby version
72+
appraise "coverage" do
73+
gem "mutex_m", "~> 0.2"
74+
gem "stringio", "~> 3.0"
75+
eval_gemfile "modular/coverage.gemfile"
76+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
77+
end
78+
79+
# Only run linter on latest Ruby version (but, in support of oldest supported Ruby version)
80+
appraise "style" do
81+
gem "mutex_m", "~> 0.2"
82+
gem "stringio", "~> 3.0"
83+
eval_gemfile "modular/style.gemfile"
84+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
85+
end
86+
87+
appraise "ruby-head" do
88+
gem "mutex_m", ">= 0.2"
89+
gem "stringio", ">= 3.0"
90+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
91+
end
92+
93+
appraise "truffleruby-head" do
94+
gem "mutex_m", ">= 0.2"
95+
gem "stringio", ">= 3.0"
96+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
97+
end
98+
99+
appraise "jruby-head" do
100+
gem "mutex_m", ">= 0.2"
101+
gem "stringio", ">= 3.0"
102+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
103+
end

Gemfile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,33 @@ platform :mri do
1313
gem "byebug", ">= 11"
1414
end
1515

16-
# Coverage
17-
gem "kettle-soup-cover", "~> 1.0", ">= 1.0.4"
16+
# Documentation
17+
18+
19+
source "https://rubygems.org"
20+
21+
#### IMPORTANT #######################################################
22+
# Gemfile is for local development ONLY; Gemfile is NOT loaded in CI #
23+
####################################################### IMPORTANT ####
24+
25+
# Specify your gem's general development dependencies in turbo_tests.gemspec
26+
gemspec
27+
28+
# Security Audit
29+
if RUBY_VERSION >= "3"
30+
# NOTE: Audit fails on Ruby 2.7 because nokogiri has dropped support for Ruby < 3
31+
# See: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-r95h-9x8f-r3f7
32+
# We can't add upgraded nokogiri here unless we are developing on Ruby 3+
33+
eval_gemfile "gemfiles/modular/audit.gemfile"
34+
end
35+
36+
# Code Coverage
37+
eval_gemfile "gemfiles/modular/coverage.gemfile"
1838

1939
# Linting
20-
gem "rubocop-lts", "~> 8.1", ">= 8.1.1" # Linting for Ruby >= 2.2
21-
gem "rubocop-packaging", "~> 0.5", ">= 0.5.2"
22-
gem "rubocop-rspec", "~> 2.10"
40+
eval_gemfile "gemfiles/modular/style.gemfile"
2341

2442
# Documentation
25-
gem "github-markup", "~> 5.0", ">= 5.0.1"
26-
gem "rdoc", "~> 6.11"
27-
gem "redcarpet", "~> 3.6"
28-
gem "yard", "~> 0.9", ">= 0.9.37"
29-
gem "yard-junk", "~> 0.0", ">= 0.0.10"
43+
eval_gemfile "gemfiles/modular/documentation.gemfile"
44+
45+
gem "appraisal", github: "pboling/appraisal", branch: "eval_gemfile"

gemfiles/audit.gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "mutex_m", "~> 0.2"
6+
gem "stringio", "~> 3.0"
7+
8+
gemspec path: "../"
9+
10+
eval_gemfile("modular/audit.gemfile")

gemfiles/coverage.gemfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
1+
# This file was generated by Appraisal
22

33
source "https://rubygems.org"
44

5-
# Root Gemfile is only for local development only. It is not loaded on CI.
6-
# On CI we only need the gemspecs' dependencies (including development dependencies).
7-
# Exceptions, if any, will be found in gemfiles/*.gemfile
8-
gem "kettle-soup-cover", "~> 1.0", ">= 1.0.2"
5+
gem "mutex_m", "~> 0.2"
6+
gem "stringio", "~> 3.0"
97

108
gemspec path: "../"
9+
10+
eval_gemfile("modular/coverage.gemfile")

gemfiles/jruby_head.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "mutex_m", ">= 0.2"
6+
gem "stringio", ">= 3.0"
7+
8+
gemspec path: "../"

gemfiles/modular/audit.gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
# Many gems are dropping support for Ruby < 3,
4+
# so we only want to run our security audit in CI on Ruby 3+
5+
gem "bundler-audit", "~> 0.9.2"

0 commit comments

Comments
 (0)