Skip to content

Commit

Permalink
Actions - Add Windows CI (ohler55#727)
Browse files Browse the repository at this point in the history
* [CI] - add windows-2022 2.6 - master

* test_saj.rb - fix for windows paths

* [CI] rakefile & .gitignore
  • Loading branch information
MSP-Greg authored Dec 16, 2021
1 parent 0f832cb commit e8c96e7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: CI
on:
push:
branches:
- develop
- master
- '*'
pull_request:

jobs:
Expand Down Expand Up @@ -49,3 +48,22 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake

Windows:
strategy:
fail-fast: false
matrix:
ruby: [ ucrt, '3.0', 2.7, 2.6 ]

env:
BUNDLE_GEMFILE: gemfiles/no_rails.gemfile
MAKE: make -j 2
runs-on: windows-2022
name: Ruby ${{ matrix.ruby }} (windows-2022)
steps:
- uses: actions/checkout@v2
- uses: MSP-Greg/ruby-setup-ruby@win-ucrt-1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Gemfile.lock
*.so
vendor
gemfiles/*.lock
tmp
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ end
=end

task :test_all => [:clean, :compile] do
STDOUT.flush
exitcode = 0
status = 0

cmds = "ruby test/tests.rb && ruby test/tests_mimic.rb && ruby test/tests_mimic_addition.rb"
puts "\n" + "#"*90
puts cmds
STDOUT.syswrite "\n#{'#'*90}\n#{cmds}\n"
Bundler.with_original_env do
status = system(cmds)
end
Expand All @@ -33,10 +33,10 @@ task :test_all => [:clean, :compile] do
# tests.
if RUBY_VERSION >= '2.4'
Dir.glob('test/json_gem/*_test.rb').each do |file|
cmd = "REAL_JSON_GEM=1 bundle exec ruby -Itest #{file}"
puts "\n" + "#"*90
puts cmd
cmd = "bundle exec ruby -Itest #{file}"
STDOUT.syswrite "\n#{'#'*90}\n#{cmd}\n"
Bundler.with_original_env do
ENV['REAL_JSON_GEM'] = '1'
status = system(cmd)
end
exitcode = 1 unless status
Expand Down
2 changes: 1 addition & 1 deletion test/test_saj.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_fixnum_bad
assert_equal([:add_value, 12345, nil], handler.calls.first)
type, message, line, column = handler.calls.last
assert_equal([:error, 1, 6], [type, line, column])
assert_match(%r{invalid format, extra characters at line 1, column 6 \[(?:[a-z\.]+/)*saj\.c:\d+\]}, message)
assert_match(%r{invalid format, extra characters at line 1, column 6 \[(?:[A-Za-z]:\/)?(?:[a-z\.]+/)*saj\.c:\d+\]}, message)
end

end

0 comments on commit e8c96e7

Please sign in to comment.