Skip to content

Commit

Permalink
Add Ruby build matrix (#2)
Browse files Browse the repository at this point in the history
Test across multiple Ruby versions, including future versions. This way we have an easier time updating onelife to newer Ruby versions.

I've copied updates necessary from upstream, and added a couple later Ruby versions:

- kputnam#245
- kputnam@c3f4008
  • Loading branch information
adamstegman authored Jan 18, 2024
1 parent a85d45d commit 6f216c9
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: build

on: [pull_request, push]

jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby:
- head
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
- '2.6'
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ DEPENDENCIES
yard (~> 0.9.20)

BUNDLED WITH
1.17.3
2.4.19
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ task :default => :spec
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new do |t|
t.verbose = false
t.rspec_opts = %w(-w -rspec_helper)
t.rspec_opts = "-w -rspec_helper"

if ENV.include?("CI") or ENV.include?("TRAVIS")
t.rspec_opts += %w(--format progress)
t.rspec_opts += " --format progress"
else
t.rspec_opts += %w(--format documentation)
t.rspec_opts += " --format documentation"
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/stupidedi/versions/common/element_types/r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ def to_x12(truncate = true)
if rounded.zero?
"0" * definition.min_length
else
sign + rounded.abs.to_s("F").
base = rounded.abs
base = base.is_a?(BigDecimal) ? base : BigDecimal(base)
sign + base.to_s("F").
gsub(/^0+/, ""). # leading zeros
gsub(/0+$/, ""). # trailing zeros
gsub(/\.$/, ""). # trailing decimal point
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
end

require File.expand_path("../../lib/stupidedi", __FILE__)
require "ruby/blank"
require "pp"
require "ostruct"

Expand Down

0 comments on commit 6f216c9

Please sign in to comment.