serialbench 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/benchmark.yml +294 -229
  3. data/.github/workflows/rake.yml +11 -0
  4. data/.github/workflows/windows-debug.yml +171 -0
  5. data/.gitignore +32 -0
  6. data/.rubocop.yml +1 -0
  7. data/.rubocop_todo.yml +274 -0
  8. data/Gemfile +15 -1
  9. data/README.adoc +41 -0
  10. data/data/schemas/result.yml +29 -0
  11. data/docs/PLATFORM_VALIDATION_FIX.md +79 -0
  12. data/docs/SYCK_YAML_FIX.md +91 -0
  13. data/docs/WEBSITE_COMPLETION_PLAN.md +440 -0
  14. data/docs/WINDOWS_LIBXML_FIX.md +136 -0
  15. data/docs/WINDOWS_SETUP.md +122 -0
  16. data/lib/serialbench/benchmark_runner.rb +3 -3
  17. data/lib/serialbench/cli/benchmark_cli.rb +74 -1
  18. data/lib/serialbench/cli/environment_cli.rb +3 -3
  19. data/lib/serialbench/cli/resultset_cli.rb +112 -26
  20. data/lib/serialbench/cli/ruby_build_cli.rb +75 -88
  21. data/lib/serialbench/cli/validate_cli.rb +88 -0
  22. data/lib/serialbench/cli.rb +6 -2
  23. data/lib/serialbench/config_manager.rb +15 -26
  24. data/lib/serialbench/models/benchmark_config.rb +12 -0
  25. data/lib/serialbench/models/benchmark_result.rb +39 -3
  26. data/lib/serialbench/models/environment_config.rb +3 -2
  27. data/lib/serialbench/models/platform.rb +61 -6
  28. data/lib/serialbench/models/result.rb +28 -1
  29. data/lib/serialbench/models/result_set.rb +8 -0
  30. data/lib/serialbench/ruby_build_manager.rb +19 -23
  31. data/lib/serialbench/runners/asdf_runner.rb +1 -1
  32. data/lib/serialbench/runners/docker_runner.rb +2 -4
  33. data/lib/serialbench/runners/local_runner.rb +71 -0
  34. data/lib/serialbench/serializers/base_serializer.rb +1 -1
  35. data/lib/serialbench/serializers/json/rapidjson_serializer.rb +1 -5
  36. data/lib/serialbench/serializers/toml/base_toml_serializer.rb +0 -2
  37. data/lib/serialbench/serializers/toml/toml_rb_serializer.rb +1 -1
  38. data/lib/serialbench/serializers/toml/tomlib_serializer.rb +1 -1
  39. data/lib/serialbench/serializers/xml/base_xml_serializer.rb +6 -1
  40. data/lib/serialbench/serializers/xml/leptris_serializer.rb +167 -0
  41. data/lib/serialbench/serializers/xml/libxml_serializer.rb +13 -8
  42. data/lib/serialbench/serializers/xml/nokogiri_serializer.rb +11 -2
  43. data/lib/serialbench/serializers/xml/oga_serializer.rb +8 -8
  44. data/lib/serialbench/serializers/xml/ox_serializer.rb +2 -2
  45. data/lib/serialbench/serializers/xml/rexml_serializer.rb +3 -3
  46. data/lib/serialbench/serializers/yaml/base_yaml_serializer.rb +1 -3
  47. data/lib/serialbench/serializers/yaml/psych_serializer.rb +1 -5
  48. data/lib/serialbench/serializers/yaml/syck_serializer.rb +1 -1
  49. data/lib/serialbench/serializers.rb +5 -3
  50. data/lib/serialbench/site_generator.rb +234 -2
  51. data/lib/serialbench/templates/assets/css/format_based.css +1 -53
  52. data/lib/serialbench/templates/assets/css/themes.css +5 -4
  53. data/lib/serialbench/templates/assets/js/chart_helpers.js +44 -14
  54. data/lib/serialbench/templates/assets/js/dashboard.js +14 -15
  55. data/lib/serialbench/templates/format_based.liquid +480 -252
  56. data/lib/serialbench/version.rb +1 -1
  57. data/lib/serialbench/yaml_validator.rb +36 -0
  58. data/serialbench.gemspec +11 -2
  59. data/site/.gitignore +5 -0
  60. data/site/README.md +32 -0
  61. data/site/astro.config.mjs +12 -0
  62. data/site/package-lock.json +6160 -0
  63. data/site/package.json +22 -0
  64. data/site/public/favicon.svg +4 -0
  65. data/site/scripts/gen-sample-data.mjs +154 -0
  66. data/site/src/components/AvailabilityMatrix.astro +61 -0
  67. data/site/src/components/CalibratedLeaderboard.vue +134 -0
  68. data/site/src/components/CitationBox.vue +50 -0
  69. data/site/src/components/DashboardConsole.vue +193 -0
  70. data/site/src/components/FeaturesTable.astro +97 -0
  71. data/site/src/components/MemoryPanel.vue +44 -0
  72. data/site/src/components/OpsChart.vue +135 -0
  73. data/site/src/config.ts +18 -0
  74. data/site/src/layouts/Layout.astro +85 -0
  75. data/site/src/lib/channels.ts +24 -0
  76. data/site/src/lib/dashboard.ts +269 -0
  77. data/site/src/pages/index.astro +44 -0
  78. data/site/src/pages/library/[slug].astro +128 -0
  79. data/site/src/pages/methodology.astro +55 -0
  80. data/site/src/styles/global.css +103 -0
  81. data/site/tsconfig.json +5 -0
  82. metadata +58 -23
  83. data/.github/workflows/ci.yml +0 -74
  84. data/.github/workflows/docker.yml +0 -272
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bd127a1fb810ad2b4a95377dd7bf7e75297ec4b989b44844131b5ac01b0ab83
4
- data.tar.gz: f594315660bf94c7c97d8a0b0f9d9aadf6b756f675cc8e1671535840840c26bd
3
+ metadata.gz: ff36b734da92061c2bbf271fd1e94f79f80d844f0b492c7f06a51aca5ed794aa
4
+ data.tar.gz: 28aeb4041d3c1c04cdcfd4b5f5ad21757ed0616277bcf34b2db15c9d56a06b5a
5
5
  SHA512:
6
- metadata.gz: 607d47dee25a4815518e7246b44830cc78d08e9852c79f06803ba073a0af71946066f287ce174f130ce5553bbe3707e76d12c5318eb5db9966a97cb69de976e2
7
- data.tar.gz: 808cc1fdd677a2b6ee5603305fa9a2da913ee2c2feae3b6ea0e648b39c99c15a01a3f89b067be9ac45b634ab330f3fb1dc2f1e02606482af2faef3118c04a484
6
+ metadata.gz: 9c497b089e84bc674bd444df875cc161ecf97b0d077d2ba9cb3c26cee91c27d8694cabc149b61f78c4fc0f9890b808a7604e6106e1d91aa04595c40a3cb6fa77
7
+ data.tar.gz: 5a8eebcfe19699b5d9e1aed3caf1c65bec4937fe51199b8da0ef152e6145deab815621c354495279236f9b7c2e0eaa8e1c70eebdc1353ffb8ff6c89c900afeaa
@@ -1,10 +1,13 @@
1
- name: benchmark
1
+ name: benchmark-weekly
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ main, master ]
5
+ branches: [main]
6
+ paths-ignore:
7
+ - '.github/workflows/windows-debug.yml'
6
8
  pull_request:
7
- branches: [ main, master ]
9
+ paths-ignore:
10
+ - '.github/workflows/windows-debug.yml'
8
11
  schedule:
9
12
  # Run benchmarks weekly on Sundays at 2 AM UTC
10
13
  - cron: '0 2 * * 0'
@@ -17,7 +20,10 @@ permissions:
17
20
  id-token: write
18
21
 
19
22
  concurrency:
20
- group: "pages"
23
+ # Renamed off "pages": that group's server-side state is wedged (a queued
24
+ # run there returns 500 on cancel and blocks the single in-progress slot),
25
+ # which starved every benchmark-weekly run after 2026-08-23 10:22Z.
26
+ group: "site-deploy"
21
27
  cancel-in-progress: false
22
28
 
23
29
  jobs:
@@ -27,250 +33,309 @@ jobs:
27
33
  ruby-versions: ${{ steps.set-matrix.outputs.ruby-versions }}
28
34
  platforms: ${{ steps.set-matrix.outputs.platforms }}
29
35
  steps:
30
- - name: Set matrix configurations
31
- id: set-matrix
32
- run: |
33
- echo 'ruby-versions=["3.1", "3.2", "3.3", "3.4"]' >> $GITHUB_OUTPUT
34
- echo 'platforms=["ubuntu-latest", "macos-latest", "windows-latest"]' >> $GITHUB_OUTPUT
36
+ - name: Set matrix configurations
37
+ id: set-matrix
38
+ run: |
39
+ echo 'ruby-versions=["3.2", "3.3", "3.4", "4.0"]' >> $GITHUB_OUTPUT
40
+ echo 'platforms=["ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-14", "macos-15", "macos-15-intel", "macos-26", "macos-26-intel", "windows-2022", "windows-2025", "windows-11-arm"]' >> $GITHUB_OUTPUT
35
41
 
36
42
  # Cross-platform native benchmarks
37
43
  benchmark:
38
44
  runs-on: ${{ matrix.platform }}
39
45
  needs: setup
40
46
  strategy:
47
+ fail-fast: false
41
48
  matrix:
42
49
  platform: ${{ fromJson(needs.setup.outputs.platforms) }}
43
50
  ruby-version: ${{ fromJson(needs.setup.outputs.ruby-versions) }}
44
- fail-fast: false
51
+ exclude:
52
+ # RubyInstaller ships no arm64 builds for Ruby 3.2/3.3;
53
+ # windows-11-arm runs 3.4.x and 4.x only
54
+ - platform: windows-11-arm
55
+ ruby-version: "3.2"
56
+ - platform: windows-11-arm
57
+ ruby-version: "3.3"
45
58
 
46
59
  steps:
47
- - name: Checkout repository
48
- uses: actions/checkout@v4
49
-
50
- - name: Set up Ruby ${{ matrix.ruby-version }}
51
- uses: ruby/setup-ruby@v1
52
- with:
53
- ruby-version: ${{ matrix.ruby-version }}
54
- bundler-cache: true
55
-
56
- - name: Install system dependencies (Ubuntu)
57
- if: matrix.platform == 'ubuntu-latest'
58
- run: |
59
- sudo apt-get update
60
- sudo apt-get install -y libxml2-dev libxslt1-dev build-essential
61
-
62
- - name: Install system dependencies (macOS)
63
- if: matrix.platform == 'macos-latest'
64
- run: |
65
- brew install libxml2 libxslt
66
-
67
- - name: Install system dependencies (Windows)
68
- if: matrix.platform == 'windows-latest'
69
- run: |
70
- # Windows dependencies are typically handled by gem installations
71
- echo "Windows dependencies handled by gems"
72
-
73
- - name: Install gems
74
- run: |
75
- bundle install
76
-
77
- - name: List available serializers
78
- run: bundle exec serialbench list
79
-
80
- - name: Run benchmarks
81
- run: |
82
- if [ "${{ matrix.platform }}" = "macos-latest" ]; then
83
- # macOS can handle full benchmarks
84
- bundle exec serialbench benchmark \
85
- --formats xml json yaml toml \
86
- --iterations 5 \
87
- --warmup 2
88
- else
89
- # Windows and Ubuntu use short configuration for memory efficiency
90
- bundle exec serialbench benchmark \
91
- --config config/short.yml
92
- fi
93
- shell: bash
94
-
95
- - name: Run tests to verify functionality
96
- run: bundle exec rspec --format documentation
97
-
98
- - name: Upload benchmark results
99
- uses: actions/upload-artifact@v4
100
- with:
101
- name: benchmark-results-${{ matrix.platform }}-ruby-${{ matrix.ruby-version }}
102
- path: results/
103
- retention-days: 30
104
-
105
- # Merge results and deploy to GitHub Pages
106
- merge-and-deploy:
107
- if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
108
- runs-on: ubuntu-latest
109
- needs: [setup, benchmark]
60
+ - name: Checkout repository
61
+ uses: actions/checkout@v4
62
+
63
+ - name: Detect Windows architecture
64
+ id: windows-arch
65
+ if: startsWith(matrix.platform, 'windows-')
66
+ run: |
67
+ if [[ "${{ matrix.platform }}" == *"-arm" ]]; then
68
+ echo "arch=arm64-windows" >> $GITHUB_OUTPUT
69
+ else
70
+ echo "arch=x64-windows" >> $GITHUB_OUTPUT
71
+ fi
72
+ shell: bash
73
+
74
+ - name: Install vcpkg dependencies (Windows)
75
+ if: startsWith(matrix.platform, 'windows-')
76
+ run: |
77
+ vcpkg install libxml2:${{ steps.windows-arch.outputs.arch }} libxslt:${{ steps.windows-arch.outputs.arch }} 2>&1 || true
78
+ vcpkg integrate install 2>&1 || true
79
+ # vcpkg dynamic triplets put the DLLs in bin/; nokogiri's compiled
80
+ # extension needs them on PATH at require time.
81
+ echo "C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/bin" >> $GITHUB_PATH
82
+ shell: bash
83
+
84
+ - name: Configure bundler for libxml2 (Windows)
85
+ if: startsWith(matrix.platform, 'windows-')
86
+ run: |
87
+ mkdir -p .bundle 2>&1 || true
88
+ echo "---" > .bundle/config 2>&1 || true
89
+ echo 'BUNDLE_BUILD__LIBXML___RUBY: "--with-xml2-dir=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }} --with-xml2-include=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/include/libxml2 --with-xml2-lib=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/lib"' >> .bundle/config 2>&1 || true
90
+ # windows-11-arm has no precompiled nokogiri (pulled transitively via
91
+ # moxml); build it against the vcpkg libxml2 instead of the vendored
92
+ # source build that fails on ucrt/ARM64. Harmless on x64 Windows,
93
+ # where the precompiled gem makes this config moot.
94
+ echo 'BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries --with-xml2-include=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/include/libxml2 --with-xml2-lib=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/lib --with-xslt-include=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/include/libxslt --with-xslt-lib=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/lib --with-zlib-dir=C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}"' >> .bundle/config 2>&1 || true
95
+ shell: bash
96
+
97
+ - name: Set up Ruby ${{ matrix.ruby-version }}
98
+ uses: ruby/setup-ruby@v1
99
+ with:
100
+ ruby-version: ${{ matrix.ruby-version }}
101
+ bundler-cache: true
102
+
103
+ # The directory of ruby.exe is always in the DLL search path (unlike
104
+ # PATH manipulation across step boundaries), so stage the vcpkg DLLs
105
+ # there for the system-built nokogiri on Windows ARM.
106
+ - name: Stage vcpkg DLLs beside ruby.exe (Windows)
107
+ if: startsWith(matrix.platform, 'windows-')
108
+ run: |
109
+ RUBY_BIN="$(dirname "$(command -v ruby)")"
110
+ echo "Staging vcpkg DLLs into $RUBY_BIN"
111
+ ls "C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/bin/" || true
112
+ cp -f "C:/vcpkg/installed/${{ steps.windows-arch.outputs.arch }}/bin/"*.dll "$RUBY_BIN/" 2>&1 || true
113
+ shell: bash
114
+
115
+ - name: Install system dependencies (Ubuntu)
116
+ if: startsWith(matrix.platform, 'ubuntu-')
117
+ run: |
118
+ sudo apt-get update
119
+ sudo apt-get install -y libxml2-dev libxslt1-dev build-essential
120
+
121
+ - name: Install system dependencies (macOS)
122
+ if: startsWith(matrix.platform, 'macos-')
123
+ run: |
124
+ brew install libxml2 libxslt
125
+
126
+ - name: Debug Ruby platform (Windows only)
127
+ if: startsWith(matrix.platform, 'windows-')
128
+ shell: ruby {0}
129
+ run: |
130
+ puts "=== Ruby Platform Debug Info ==="
131
+ puts "RUBY_PLATFORM: #{RUBY_PLATFORM}"
132
+ puts "Gem.win_platform?: #{Gem.win_platform?}"
133
+ puts "RbConfig::CONFIG['host_os']: #{RbConfig::CONFIG['host_os']}"
134
+ puts "RbConfig::CONFIG['host_cpu']: #{RbConfig::CONFIG['host_cpu']}"
135
+ puts "RbConfig::CONFIG['arch']: #{RbConfig::CONFIG['arch']}"
136
+ puts "================================"
137
+
138
+ - name: Install gems
139
+ run: bundle install
140
+
141
+ # ubuntu-22.04's glibc (2.35) predates the precompiled leptris gem's
142
+ # build host, so the gem's vendored libleptris.so fails to dlopen there
143
+ # and the adapter reports leptris unavailable (empty availability dots
144
+ # on the site). Leptris is pure C99 — build the lib from the gem's
145
+ # tagged source and point the FFI loader at it; LEPTRIS_LIB_PATH is the
146
+ # first candidate in the gem's ffi_lib list.
147
+ - name: Build libleptris from source (Ubuntu 22.04)
148
+ if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-22.04-arm'
149
+ run: |
150
+ LEPTRIS_VERSION=$(bundle exec ruby -e "require 'leptris'; print Leptris::VERSION")
151
+ echo "Building libleptris ${LEPTRIS_VERSION}"
152
+ curl -sL "https://github.com/leptris/leptris/archive/refs/tags/v${LEPTRIS_VERSION}.tar.gz" | tar xz
153
+ cmake -S "leptris-${LEPTRIS_VERSION}" -B /tmp/leptris-build \
154
+ -DLEPTRIS_BUILD_SHARED=ON -DLEPTRIS_BUILD_STATIC=OFF -DBUILD_TESTING=OFF \
155
+ -DLEPTRIS_BUILD_CLI=OFF -DLEPTRIS_BUILD_BENCHMARKS=OFF -DLEPTRIS_BUILD_MAN_PAGES=OFF \
156
+ -DLEPTRIS_ENABLE_UTF8PROC=OFF -DLEPTRIS_ENABLE_ICONV=OFF
157
+ cmake --build /tmp/leptris-build -j"$(nproc)"
158
+ LIBLEPTRIS=$(find /tmp/leptris-build -name 'libleptris.so*' -type f | head -1)
159
+ echo "Built ${LIBLEPTRIS}"
160
+ echo "LEPTRIS_LIB_PATH=${LIBLEPTRIS}" >> "$GITHUB_ENV"
161
+ shell: bash
162
+
163
+ - name: Update Ruby-Build cache
164
+ run: bundle exec serialbench ruby-build update
165
+ env:
166
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167
+
168
+ - name: Create environment config
169
+ run: |
170
+ mkdir -p config/environments
171
+ cat > config/environments/ci-ruby-${{ matrix.ruby-version }}.yml << EOF
172
+ ---
173
+ name: ci-ruby-${{ matrix.ruby-version }}-${{ matrix.platform }}
174
+ kind: local
175
+ created_at: '$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
176
+ ruby_build_tag: "${{ matrix.ruby-version }}"
177
+ description: CI environment for Ruby ${{ matrix.ruby-version }} on ${{ matrix.platform }}
178
+ EOF
179
+ shell: bash
180
+
181
+ - name: Run benchmarks
182
+ env:
183
+ GITHUB_RUNNER_PLATFORM: ${{ matrix.platform }}
184
+ run: |
185
+ bundle exec serialbench environment execute config/environments/ci-ruby-${{ matrix.ruby-version }}.yml config/benchmarks/full.yml results/runs/ci-ruby-${{ matrix.ruby-version }}-${{ matrix.platform }}
186
+
187
+ - name: Verify benchmark results before upload
188
+ run: |
189
+ echo "=== Verifying benchmark results ==="
190
+ RESULTS_FILE="results/runs/ci-ruby-${{ matrix.ruby-version }}-${{ matrix.platform }}/results.yaml"
191
+
192
+ echo "📁 Checking file exists..."
193
+ if [ ! -f "$RESULTS_FILE" ]; then
194
+ echo "❌ ERROR: results.yaml not found at $RESULTS_FILE"
195
+ exit 1
196
+ fi
110
197
 
111
- steps:
112
- - name: Checkout repository
113
- uses: actions/checkout@v4
114
-
115
- - name: Set up Ruby (for report generation)
116
- uses: ruby/setup-ruby@v1
117
- with:
118
- ruby-version: '3.3'
119
- bundler-cache: true
120
-
121
- - name: Install system dependencies
122
- run: |
123
- sudo apt-get update
124
- sudo apt-get install -y libxml2-dev libxslt1-dev build-essential
125
-
126
- - name: Install gems
127
- run: bundle install
128
-
129
- - name: Download all benchmark artifacts
130
- uses: actions/download-artifact@v4
131
- with:
132
- pattern: benchmark-results-*
133
- path: artifacts/
134
-
135
- - name: List downloaded artifacts
136
- run: |
137
- echo "Downloaded artifacts:"
138
- find artifacts/ -type f -name "*.json" -o -name "*.html" | head -20
139
-
140
- - name: Generate comprehensive GitHub Pages
141
- run: |
142
- mkdir -p docs
143
-
144
- # Find all result directories
145
- RESULT_DIRS=""
146
- for dir in artifacts/benchmark-results-*/; do
147
- if [ -d "$dir" ]; then
148
- RESULT_DIRS="$RESULT_DIRS $dir"
198
+ echo "📊 Checking file size..."
199
+ SIZE=$(wc -c < "$RESULTS_FILE" | tr -d ' ')
200
+ echo " File size: $SIZE bytes"
201
+
202
+ if [ "$SIZE" -lt 1000 ]; then
203
+ echo "❌ ERROR: results.yaml is suspiciously small ($SIZE bytes)"
204
+ echo " Expected at least 1000 bytes for valid benchmark results"
205
+ echo "=== File contents ==="
206
+ cat "$RESULTS_FILE"
207
+ exit 1
149
208
  fi
150
- done
151
-
152
- echo "Processing result directories: $RESULT_DIRS"
153
-
154
- # Generate GitHub Pages from all results
155
- if [ -n "$RESULT_DIRS" ]; then
156
- bundle exec serialbench github_pages $RESULT_DIRS docs/
157
- else
158
- echo "No result directories found, creating placeholder page"
159
- echo "<html><body><h1>No benchmark results available</h1></body></html>" > docs/index.html
160
- fi
161
-
162
- - name: Create platform comparison summary
163
- run: |
164
- # Create a summary of cross-platform results
165
- cat > docs/platform-summary.md << 'EOF'
166
- # Cross-Platform Benchmark Summary
167
-
168
- This page contains benchmark results from multiple platforms and Ruby versions:
169
-
170
- ## Platforms Tested
171
- - **Ubuntu Latest**: Linux x86_64 environment
172
- - **macOS Latest**: Apple Silicon and Intel Mac environment
173
- - **Windows Latest**: Windows Server environment
174
-
175
- ## Ruby Versions
176
- - Ruby 3.1, 3.2, 3.3, 3.4
177
-
178
- ## Serialization Libraries
179
- - **XML**: REXML, Ox, Nokogiri, Oga, LibXML
180
- - **JSON**: JSON, Oj, RapidJSON, YAJL
181
- - **YAML**: Psych, Syck
182
- - **TOML**: TOML-RB, Tomlib
183
-
184
- Results show performance variations across different operating systems and architectures.
185
- EOF
186
-
187
- - name: Setup Pages
188
- uses: actions/configure-pages@v4
189
-
190
- - name: Upload to GitHub Pages
191
- uses: actions/upload-pages-artifact@v3
192
- with:
193
- path: docs
194
-
195
- - name: Deploy to GitHub Pages
196
- id: deployment
197
- uses: actions/deploy-pages@v4
198
-
199
- # Performance comparison analysis
200
- performance-analysis:
201
- if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
209
+
210
+ echo "✅ File size OK: $SIZE bytes"
211
+ shell: bash
212
+
213
+ - name: Validate YAML schema
214
+ run: |
215
+ bundle exec serialbench validate result results/runs/ci-ruby-${{ matrix.ruby-version }}-${{ matrix.platform }}/results.yaml
216
+
217
+ - name: Upload benchmark results
218
+ uses: actions/upload-artifact@v4
219
+ with:
220
+ name: benchmark-results-${{ matrix.platform }}-ruby-${{ matrix.ruby-version }}
221
+ path: results/runs/ci-ruby-${{ matrix.ruby-version }}-${{ matrix.platform }}
222
+ retention-days: 30
223
+
224
+ # Aggregate results and deploy to GitHub Pages
225
+ deploy-pages:
226
+ if: github.ref == 'refs/heads/main'
202
227
  runs-on: ubuntu-latest
203
- needs: [benchmark]
228
+ needs: [setup, benchmark]
229
+ environment:
230
+ name: github-pages
231
+ url: ${{ steps.deployment.outputs.page_url }}
204
232
 
205
233
  steps:
206
- - name: Checkout repository
207
- uses: actions/checkout@v4
208
-
209
- - name: Download all benchmark results
210
- uses: actions/download-artifact@v4
211
- with:
212
- pattern: benchmark-results-*-ruby-*
213
- path: analysis/
214
-
215
- - name: Set up Ruby for analysis
216
- uses: ruby/setup-ruby@v1
217
- with:
218
- ruby-version: '3.3'
219
- bundler-cache: true
220
-
221
- - name: Install dependencies
222
- run: |
223
- sudo apt-get update
224
- sudo apt-get install -y libxml2-dev libxslt1-dev
225
- bundle install
226
-
227
- - name: Generate performance analysis
228
- run: |
229
- bundle exec serialbench analyze_performance analysis/benchmark-results-*/ performance_analysis.json
230
-
231
- - name: Generate platform comparison report
232
- run: |
233
- bundle exec serialbench platform_comparison performance_analysis.json platform_comparison.json
234
-
235
- - name: Upload performance analysis
236
- uses: actions/upload-artifact@v4
237
- with:
238
- name: performance-analysis
239
- path: |
240
- performance_analysis.json
241
- platform_comparison.json
242
- retention-days: 90
234
+ - name: Checkout repository
235
+ uses: actions/checkout@v4
236
+
237
+ - name: Set up Ruby
238
+ uses: ruby/setup-ruby@v1
239
+ with:
240
+ ruby-version: '3.3'
241
+ bundler-cache: true
242
+
243
+ - name: Install system dependencies
244
+ run: |
245
+ sudo apt-get update
246
+ sudo apt-get install -y libxml2-dev libxslt1-dev build-essential
247
+
248
+ - name: Install gems
249
+ run: bundle install
250
+
251
+ - name: Download all benchmark artifacts
252
+ uses: actions/download-artifact@v4
253
+ with:
254
+ pattern: benchmark-results-*
255
+ path: artifacts/
256
+
257
+ - name: List downloaded artifacts structure
258
+ run: |
259
+ echo "=== Artifacts directory structure ==="
260
+ ls -la artifacts/
261
+ echo ""
262
+ echo "=== Searching for results.yaml files ==="
263
+ find artifacts/ -name "results.yaml" -type f
264
+ echo ""
265
+ echo "=== Directory tree (first 3 levels) ==="
266
+ find artifacts/ -maxdepth 3 -type d | sort
267
+
268
+ - name: Create resultset
269
+ run: |
270
+ mkdir -p results/sets
271
+ bundle exec serialbench resultset create weekly-benchmark results/sets/weekly-benchmark
272
+
273
+ - name: Add all results to resultset
274
+ run: |
275
+ bundle exec serialbench resultset add-result results/sets/weekly-benchmark artifacts/benchmark-results-*/
276
+
277
+ - name: Export dashboard payload and raw data
278
+ run: |
279
+ bundle exec serialbench resultset export-data results/sets/weekly-benchmark site/src/data/sample.json --raw-data-dir site/public/data
280
+
281
+ - name: Set up Node
282
+ uses: actions/setup-node@v4
283
+ with:
284
+ node-version: '24'
285
+ cache: npm
286
+ cache-dependency-path: site/package-lock.json
287
+
288
+ - name: Build site
289
+ run: |
290
+ cd site
291
+ npm ci
292
+ npm run build
293
+
294
+ - name: Setup Pages
295
+ uses: actions/configure-pages@v4
296
+
297
+ - name: Upload to GitHub Pages
298
+ uses: actions/upload-pages-artifact@v3
299
+ with:
300
+ path: site/dist
301
+
302
+ - name: Deploy to GitHub Pages
303
+ id: deployment
304
+ uses: actions/deploy-pages@v4
243
305
 
244
306
  # Summary job
245
307
  summary:
246
308
  runs-on: ubuntu-latest
247
- needs: [setup, benchmark, merge-and-deploy, performance-analysis]
309
+ needs: [setup, benchmark, deploy-pages]
248
310
  if: always()
249
311
  steps:
250
- - name: Generate workflow summary
251
- run: |
252
- echo "## Cross-Platform Benchmark Summary" >> $GITHUB_STEP_SUMMARY
253
- echo "" >> $GITHUB_STEP_SUMMARY
254
- echo "**Benchmark Status**: ${{ needs.benchmark.result }}" >> $GITHUB_STEP_SUMMARY
255
- echo "**Deploy Status**: ${{ needs.merge-and-deploy.result }}" >> $GITHUB_STEP_SUMMARY
256
- echo "**Analysis Status**: ${{ needs.performance-analysis.result }}" >> $GITHUB_STEP_SUMMARY
257
- echo "" >> $GITHUB_STEP_SUMMARY
258
- echo "### Platforms Tested" >> $GITHUB_STEP_SUMMARY
259
- echo "- Ubuntu Latest (Linux x86_64)" >> $GITHUB_STEP_SUMMARY
260
- echo "- macOS Latest (Apple Silicon/Intel)" >> $GITHUB_STEP_SUMMARY
261
- echo "- Windows Latest (Windows Server)" >> $GITHUB_STEP_SUMMARY
262
- echo "" >> $GITHUB_STEP_SUMMARY
263
- echo "### Ruby Versions" >> $GITHUB_STEP_SUMMARY
264
- echo "- Ruby 3.1, 3.2, 3.3, 3.4" >> $GITHUB_STEP_SUMMARY
265
- echo "" >> $GITHUB_STEP_SUMMARY
266
- echo "### Serialization Libraries" >> $GITHUB_STEP_SUMMARY
267
- echo "- **XML**: REXML, Ox, Nokogiri, Oga, LibXML" >> $GITHUB_STEP_SUMMARY
268
- echo "- **JSON**: JSON, Oj, RapidJSON, YAJL" >> $GITHUB_STEP_SUMMARY
269
- echo "- **YAML**: Psych, Syck" >> $GITHUB_STEP_SUMMARY
270
- echo "- **TOML**: TOML-RB, Tomlib" >> $GITHUB_STEP_SUMMARY
271
- echo "" >> $GITHUB_STEP_SUMMARY
272
- if [ "${{ github.ref }}" == "refs/heads/main" ] || [ "${{ github.ref }}" == "refs/heads/master" ]; then
273
- echo "### Results" >> $GITHUB_STEP_SUMMARY
274
- echo "📊 [View Interactive Results](https://metanorma.github.io/serialbench/)" >> $GITHUB_STEP_SUMMARY
275
- echo "📈 Performance analysis and platform comparison available in artifacts" >> $GITHUB_STEP_SUMMARY
276
- fi
312
+ - name: Generate workflow summary
313
+ run: |
314
+ echo "## Weekly Benchmark Summary" >> $GITHUB_STEP_SUMMARY
315
+ echo "" >> $GITHUB_STEP_SUMMARY
316
+ echo "**Benchmark Status**: ${{ needs.benchmark.result }}" >> $GITHUB_STEP_SUMMARY
317
+ echo "**Deploy Status**: ${{ needs.deploy-pages.result }}" >> $GITHUB_STEP_SUMMARY
318
+ echo "" >> $GITHUB_STEP_SUMMARY
319
+ echo "### Platforms Tested" >> $GITHUB_STEP_SUMMARY
320
+ echo "- Ubuntu Latest (Linux x86_64)" >> $GITHUB_STEP_SUMMARY
321
+ echo "- Ubuntu 24.04 (Linux ARM64)" >> $GITHUB_STEP_SUMMARY
322
+ echo "- Ubuntu 22.04 (Linux ARM64)" >> $GITHUB_STEP_SUMMARY
323
+ echo "- macOS 14 (Apple Silicon ARM64)" >> $GITHUB_STEP_SUMMARY
324
+ echo "- macOS 15 (Apple Silicon ARM64)" >> $GITHUB_STEP_SUMMARY
325
+ echo "- macOS 15 Intel (Intel x86_64)" >> $GITHUB_STEP_SUMMARY
326
+ echo "- macOS 26 (Apple Silicon ARM64)" >> $GITHUB_STEP_SUMMARY
327
+ echo "- macOS 26 Intel (Intel x86_64)" >> $GITHUB_STEP_SUMMARY
328
+ echo "" >> $GITHUB_STEP_SUMMARY
329
+ echo "### Ruby Versions" >> $GITHUB_STEP_SUMMARY
330
+ echo "- Ruby 3.2, 3.3, 3.4, 4.0" >> $GITHUB_STEP_SUMMARY
331
+ echo "" >> $GITHUB_STEP_SUMMARY
332
+ echo "### Serialization Libraries" >> $GITHUB_STEP_SUMMARY
333
+ echo "- **XML**: REXML, Ox, Nokogiri, Oga, LibXML, Leptris" >> $GITHUB_STEP_SUMMARY
334
+ echo "- **JSON**: JSON, Oj, RapidJSON, YAJL" >> $GITHUB_STEP_SUMMARY
335
+ echo "- **YAML**: Psych" >> $GITHUB_STEP_SUMMARY
336
+ echo "- **TOML**: TOML-RB, Tomlib, tomlrb" >> $GITHUB_STEP_SUMMARY
337
+ echo "" >> $GITHUB_STEP_SUMMARY
338
+ if [ "${{ github.ref }}" == "refs/heads/main" ]; then
339
+ echo "### Results" >> $GITHUB_STEP_SUMMARY
340
+ echo "📊 [View Interactive Dashboard](https://metanorma.github.io/serialbench/)" >> $GITHUB_STEP_SUMMARY
341
+ fi
@@ -6,10 +6,21 @@ on:
6
6
  push:
7
7
  branches: [ master, main ]
8
8
  tags: [ v* ]
9
+ paths-ignore:
10
+ - '.github/workflows/windows-debug.yml'
9
11
  pull_request:
12
+ paths-ignore:
13
+ - '.github/workflows/windows-debug.yml'
10
14
 
11
15
  jobs:
12
16
  rake:
13
17
  uses: metanorma/ci/.github/workflows/generic-rake.yml@main
18
+ with:
19
+ before-setup-ruby: |
20
+ vcpkg install libxml2:x64-windows 2>&1 || true
21
+ vcpkg integrate install 2>&1 || true
22
+ mkdir -p .bundle 2>&1 || true
23
+ echo "---" > .bundle/config 2>&1 || true
24
+ echo 'BUNDLE_BUILD__LIBXML___RUBY: "--with-xml2-dir=C:/vcpkg/installed/x64-windows --with-xml2-include=C:/vcpkg/installed/x64-windows/include/libxml2 --with-xml2-lib=C:/vcpkg/installed/x64-windows/lib"' >> .bundle/config 2>&1 || true
14
25
  secrets:
15
26
  pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}