Skip to content

attempt fixing ruby 3.4 #580

attempt fixing ruby 3.4

attempt fixing ruby 3.4 #580

Workflow file for this run

name: Run Tests
on:
push:
branches:
- '*'
jobs:
run-tests-linux:
strategy:
fail-fast: false
matrix:
ruby: [ '3.2', '3.3', '3.4', '4.0' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: sudo apt-get install -y xz-utils gcc
- name: Build stub and run tests
env:
OCRAN_DEBUG: "1"
run: |
bundle exec rake build
bundle exec rake test
- name: Build zlib fixture for cross-distro test
env:
OCRAN_DEBUG: "1"
run: ruby -Ilib exe/ocran test/fixtures/zlib/zlib.rb --output /tmp/zlib_packed
- name: Run packed executable on Debian (no Ruby installed)
run: docker run --rm -e OCRAN_DEBUG=1 -v /tmp:/mnt debian:stable-slim /mnt/zlib_packed
run-tests-macos:
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-15-intel]
ruby: ['3.2', '3.3', '3.4', '4.0']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: brew install xz
- name: Build stub and run tests
run: |
bundle exec rake build
bundle exec rake test
- name: Build zlib fixture for cross-system test
run: ruby -Ilib exe/ocran test/fixtures/zlib/zlib.rb --output zlib_packed
- name: Upload packed binary
uses: actions/upload-artifact@v4
with:
name: zlib-macos-${{ matrix.os }}-${{ matrix.ruby }}
path: zlib_packed
retention-days: 1
test-macos-portability:
needs: run-tests-macos
strategy:
fail-fast: false
matrix:
os: [ macos-14, macos-15-intel ]
ruby: [ '3.2', '3.3', '3.4', '4.0' ]
runs-on: ${{ matrix.os }}
steps:
- name: Download packed binary
uses: actions/download-artifact@v4
with:
name: zlib-macos-${{ matrix.os }}-${{ matrix.ruby }}
- name: Run packed executable
run: |
chmod +x zlib_packed
./zlib_packed
test-source-gem-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04-arm
- os: windows-11-arm
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '4.0'
- name: Install build dependencies
if: runner.os == 'Linux'
run: sudo apt-get install -y xz-utils gcc make
- name: Build and install source gem
run: |
gem build ocran-source.gemspec
gem install --local ocran-*.gem
- name: Build zlib executable and run portability test (Linux)
if: runner.os == 'Linux'
run: |
ocran test/fixtures/zlib/zlib.rb --output /tmp/zlib_from_source_gem
docker run --rm -v /tmp:/mnt debian:stable-slim /mnt/zlib_from_source_gem
- name: Build and run zlib executable (Windows)
if: runner.os == 'Windows'
run: |
ocran test/fixtures/zlib/zlib.rb --output zlib_from_source_gem.exe
.\zlib_from_source_gem.exe
run-tests-windows:
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
#ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: [ '3.4' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Cache Inno Setup
id: cache-innosetup
uses: actions/cache@v4
with:
path: C:\Program Files (x86)\Inno Setup 6
key: innosetup-6.7.1
- name: Install Inno Setup
if: steps.cache-innosetup.outputs.cache-hit != 'true'
shell: pwsh
env:
INNOSETUP_VERSION: "6.7.1"
INNOSETUP_SHA256: "4D11E8050B6185E0D49BD9E8CC661A7A59F44959A621D31D11033124C4E8A7B0"
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest `
-UseBasicParsing `
-Uri "https://github.com/jrsoftware/issrc/releases/download/is-$($env:INNOSETUP_VERSION -replace '\.','_')/innosetup-$($env:INNOSETUP_VERSION).exe" `
-OutFile innosetup.exe
$actual = (Get-FileHash innosetup.exe -Algorithm SHA256).Hash
if ($actual -ne $env:INNOSETUP_SHA256) {
Write-Error "Hash mismatch: expected $($env:INNOSETUP_SHA256), got $actual"
exit 1
}
Write-Host "SHA256 OK"
.\innosetup.exe /verysilent /allusers /suppressmsgboxes /norestart
- name: Add Inno Setup to PATH
shell: pwsh
run: echo "C:\Program Files (x86)\Inno Setup 6" >> $env:GITHUB_PATH
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install bundle
run: bundle install
# - name: Install Tcl/Tk MSYS2 packages
# shell: pwsh
# run: ridk exec pacman -S --noconfirm mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-tk
- name: Build stub and run tests
run: |
bundle exec rake build
bundle exec rake test
- name: Build zlib fixture for portability test
run: bundle exec ruby -Ilib exe/ocran test/fixtures/zlib/zlib.rb --output zlib_packed.exe
- name: Upload packed binary
uses: actions/upload-artifact@v4
with:
name: zlib-windows-${{ matrix.ruby }}
path: zlib_packed.exe
retention-days: 1
test-windows-portability:
needs: run-tests-windows
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
#ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: [ '3.4' ]
runs-on: ${{ matrix.os }}
steps:
- name: Download packed binary
uses: actions/download-artifact@v4
with:
name: zlib-windows-${{ matrix.ruby }}
- name: Run packed executable
shell: pwsh
run: |
$env:PATH = "C:\Windows\system32;C:\Windows"
.\zlib_packed.exe