Skip to content

Commit 51635ad

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

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

.github/workflows/ci.yml

+16-14
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,28 @@ 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: ~
2728
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 }
29+
- { os: ubuntu-24.04-arm, ruby: 3.4 }
30+
- { os: ubuntu-latest , ruby: 3.4, env: "JSON_DISABLE_SIMD=1" }
31+
- { os: macos-13, ruby: 3.4 }
32+
- { os: windows-latest , ruby: mswin } # ruby/ruby windows CI
33+
- { os: ubuntu-latest , ruby: jruby-9.4 } # Ruby 3.1
34+
- { os: macos-latest , ruby: truffleruby-head }
35+
- { os: ubuntu-latest , ruby: truffleruby-head }
3436
exclude:
35-
- { os: windows-latest, ruby: jruby }
36-
- { os: windows-latest, ruby: jruby-head }
37+
- { os: windows-latest, ruby: jruby }
38+
- { os: windows-latest, ruby: jruby-head }
3739

3840
steps:
3941
- uses: actions/checkout@v4
@@ -49,9 +51,9 @@ jobs:
4951
bundle config --without benchmark
5052
bundle install
5153
52-
- run: rake compile
54+
- run: rake compile ${{ matrix.env }}
5355

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

5658
- run: rake build
5759

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)