Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ruby build matrix #2

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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