Skip to content

Add GitHub Actions CI and an ActiveSupport compatibility matrix#582

Merged
CloCkWeRX merged 1 commit into
waynerobinson:masterfrom
skylabdoo:chore/ci-github-actions
Jun 9, 2026
Merged

Add GitHub Actions CI and an ActiveSupport compatibility matrix#582
CloCkWeRX merged 1 commit into
waynerobinson:masterfrom
skylabdoo:chore/ci-github-actions

Conversation

@nnc

@nnc nnc commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What

Replaces the (effectively empty) Travis config with a GitHub Actions workflow that runs the unit suite across a Ruby × ActiveSupport matrix.

  • CI (.github/workflows/ci.yml): runs bundle exec rake test (unit-only; the suite stubs all Xero HTTP, so it needs no credentials or secrets).

  • Matrix — a minimal covering set: each supported Ruby once and each supported ActiveSupport once, pinned per-cell via gemfiles/ + BUNDLE_GEMFILE:

    Ruby ActiveSupport
    3.1 7.0
    3.2 7.1
    3.3 7.2
    3.4 8.0
    4.0 8.1
    ruby-head Rails main (experimental, non-blocking)
  • Supported versions: sets required_ruby_version >= 3.1 and raises the activesupport floor to >= 7.0.

  • README: adds CI and gem-version badges.

  • Removes .travis.yml.

Notable: a load-time crash on some ActiveSupport versions

Building the matrix surfaced a real bug. lib/xeroizer.rb cherry-picks ActiveSupport core extensions (e.g. active_support/core_ext/array) without first loading active_support. Some AS versions emit a deprecation at load time from those files:

  • AS 7.1array/conversions calls ActiveSupport.deprecator
  • AS 8.2 (currently Rails main) — time/conversions references ActiveSupport::Deprecation

…both undefined unless the deprecation framework is already loaded, so require 'xeroizer' raises NoMethodError / NameError.

The fix loads just the deprecation framework (not all of ActiveSupport):

require 'active_support/deprecation'
begin
  require 'active_support/deprecator' # added in AS 7.1; absent on 7.0
rescue LoadError
end

The rescue LoadError is necessary: active_support/deprecator only exists from AS 7.1, and LoadError isn't a StandardError (so a bare rescue modifier wouldn't catch it).

Testing

All cells pass — 191 tests, 0 failures — including ruby-head + Rails main. The change touches no test files.

- CI (replaces Travis): a minimal Ruby × ActiveSupport covering matrix — each
  supported Ruby (3.1–4.0) paired with one supported ActiveSupport
  (7.0/7.1/7.2/8.0/8.1), plus an experimental ruby-head + Rails-main cell.
  Credential-free: runs `bundle exec rake test` (unit-only; tests stub all Xero
  HTTP). Per-cell ActiveSupport pinned via gemfiles/ + BUNDLE_GEMFILE.
- Load ActiveSupport's deprecation framework before cherry-picking core_ext:
  some versions emit a deprecation at load time (AS 7.1 array, AS 8.2 time)
  referencing `ActiveSupport.deprecator` / `ActiveSupport::Deprecation`. Require
  `active_support/deprecation` (+ `active_support/deprecator`, absent before 7.1)
  first, rather than all of active_support.
- Set `required_ruby_version >= 3.1` and the `activesupport` floor to `>= 7.0`.
- Add CI and gem-version badges to the README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nnc nnc mentioned this pull request Jun 8, 2026
@nnc nnc marked this pull request as ready for review June 8, 2026 23:10
@CloCkWeRX CloCkWeRX merged commit 869d5d1 into waynerobinson:master Jun 9, 2026
6 checks passed
@nnc nnc deleted the chore/ci-github-actions branch June 9, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants