Skip to content

Commit c999baf

Browse files
committed
Add a CI step with simd disabled
1 parent e3ba02a commit c999baf

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

.github/workflows/ci.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,29 @@ jobs:
1414

1515
host:
1616
needs: ruby-versions
17-
name: ${{ matrix.os }} ${{ matrix.ruby }}
17+
name: ${{ matrix.os }} ${{ matrix.ruby }} ${{ matrix.env }}
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
os:
23-
- ubuntu-latest
24-
- macos-14
25-
- windows-latest
23+
- ubuntu-latest
24+
- macos-14
25+
- windows-latest
2626
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
27+
env:
28+
- ""
2729
include:
28-
- { os: ubuntu-24.04-arm, ruby: 3.4 }
29-
- { os: macos-13, ruby: 3.4 }
30-
- { os: windows-latest , ruby: mswin } # ruby/ruby windows CI
31-
- { os: ubuntu-latest , ruby: jruby-9.4 } # Ruby 3.1
32-
- { os: macos-latest , ruby: truffleruby-head }
33-
- { os: ubuntu-latest , ruby: truffleruby-head }
30+
- { os: ubuntu-24.04-arm, ruby: 3.4 }
31+
- { os: ubuntu-latest , ruby: 3.4, env: "JSON_DISABLE_SIMD=1" }
32+
- { os: macos-13, ruby: 3.4 }
33+
- { os: windows-latest , ruby: mswin } # ruby/ruby windows CI
34+
- { os: ubuntu-latest , ruby: jruby-9.4 } # Ruby 3.1
35+
- { os: macos-latest , ruby: truffleruby-head }
36+
- { os: ubuntu-latest , ruby: truffleruby-head }
3437
exclude:
35-
- { os: windows-latest, ruby: jruby }
36-
- { os: windows-latest, ruby: jruby-head }
38+
- { os: windows-latest, ruby: jruby }
39+
- { os: windows-latest, ruby: jruby-head }
3740

3841
steps:
3942
- uses: actions/checkout@v4
@@ -49,9 +52,9 @@ jobs:
4952
bundle config --without benchmark
5053
bundle install
5154
52-
- run: rake compile
55+
- run: rake compile ${{ matrix.env }}
5356

54-
- run: rake test JSON_COMPACT=1
57+
- run: rake test JSON_COMPACT=1 ${{ matrix.env }}
5558

5659
- run: rake build
5760

ext/json/ext/generator/extconf.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
append_cflags("-std=c99")
88
$defs << "-DJSON_GENERATOR"
99

10-
if enable_config('generator-use-simd', default=true)
10+
if enable_config('generator-use-simd', default=!ENV["JSON_DISABLE_SIMD"])
1111
if RbConfig::CONFIG['host_cpu'] =~ /^(arm.*|aarch64.*)/
1212
# Try to compile a small program using NEON instructions
1313
if have_header('arm_neon.h')
@@ -31,7 +31,7 @@
3131
SRC
3232
$defs.push("-DENABLE_SIMD")
3333
end
34-
34+
3535
have_header('cpuid.h')
3636
end
3737

0 commit comments

Comments
 (0)