Skip to content

Replace 'master' terminology with 'server' #912

Replace 'master' terminology with 'server'

Replace 'master' terminology with 'server' #912

Workflow file for this run

---
name: RSpec tests
on:
pull_request: { branches: ['main'] }
push:
branches:
- main
permissions:
contents: read
env:
BUNDLE_SET: "without packaging documentation release"
jobs:
checks:
name: ${{ matrix.cfg.check }}
strategy:
matrix:
cfg:
- {check: rubocop, os: ubuntu-latest, ruby: '3.3'}
- {check: warnings, os: ubuntu-latest, ruby: '3.3'}
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout current PR
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install ruby version ${{ matrix.cfg.ruby }}
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
with:
ruby-version: ${{ matrix.cfg.ruby }}
bundler-cache: true
- name: Run ${{ matrix.cfg.check }} check
run: bundle exec rake ${{ matrix.cfg.check }}
rspec_tests:
name: ${{ matrix.cfg.os }}(ruby ${{ matrix.cfg.ruby }})
strategy:
fail-fast: false
matrix:
cfg:
- {os: ubuntu-24.04, ruby: '3.2'}
- {os: ubuntu-24.04, ruby: '3.3'}
- {os: ubuntu-24.04, ruby: '3.4'}
- {os: ubuntu-24.04, ruby: '4.0'}
- {os: ubuntu-24.04, ruby: 'jruby-10.0.5.0'}
- {os: ubuntu-24.04, ruby: 'jruby-10.1.0.0'}
- {os: windows-2025, ruby: '3.2'}
- {os: windows-2025, ruby: '3.3'}
- {os: windows-2025, ruby: '3.4'}
- {os: windows-2025, ruby: '4.0'}
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout current PR
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install ruby version ${{ matrix.cfg.ruby }}
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
with:
ruby-version: ${{ matrix.cfg.ruby }}
bundler-cache: true
- name: Output Ruby Environment
run: bundle env
- name: Build gem for all platforms
run: bundle exec rake pl_ci:gem_build
# Windows tests fail if the gem is in the filesystem
- name: Cleanup builds
if: runner.os == 'Windows'
run: Remove-Item -Path *.gem
- name: Run tests on Windows
if: runner.os == 'Windows'
run: |
# Exclude the workspace and temp dirs from Windows Defender realtime
# scanning; the specs create thousands of short-lived tmpfiles and
# scanning each one slows the suite considerably.
Add-MpPreference -ExclusionPath $Env:GITHUB_WORKSPACE, $Env:RUNNER_TEMP
# https://github.com/ruby/ruby/pull/2791/files#diff-ff5ff976e81bebd977f0834e60416abbR97-R100
# Actions uses UTF8, causes test failures, similar to normal OS setup
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
$Env:LOG_SPEC_ORDER = 'true'
# debug information
chcp
Get-WinSystemLocale
Get-ChildItem Env: | % { Write-Output "$($_.Key): $($_.Value)" }
# Enable Windows filesystem 8.3 support, see https://github.com/OpenVoxProject/openvox/pull/180
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /t REG_DWORD /v NtfsDisable8dot3NameCreation /d 0 /f
# list current OpenSSL install
gem list openssl
ruby -ropenssl -e 'puts "OpenSSL Version - #{OpenSSL::OPENSSL_VERSION}"; puts "OpenSSL Library Version - #{OpenSSL::OPENSSL_LIBRARY_VERSION}"'
# Run tests
# Note: keep the default spec grouping here. Consolidating groups
# changes which specs share a process, and the Windows registry
# integration specs are order/state sensitive (14 failures in
# spec/integration/util/windows/registry_spec.rb when run in
# larger groups).
bundle exec rake parallel:spec
- name: Run tests on Linux
if: runner.os == 'Linux'
run: |
# debug information
ruby -ropenssl -e 'puts "OpenSSL Version - #{OpenSSL::OPENSSL_VERSION}"; puts "OpenSSL Library Version - #{OpenSSL::OPENSSL_LIBRARY_VERSION}"'
if [[ ${{ matrix.cfg.ruby }} =~ "jruby" ]]; then
export _JAVA_OPTIONS='-Xmx1024m -Xms512m'
# Favor fast startup over peak JIT optimization: the suite runs in
# many short-lived processes, so cold-JIT time dominates. Note the
# trade-off: less-optimized JIT could in principle behave
# differently, but these jobs exist to test openvox under JRuby,
# not to exercise JRuby's optimizer.
export JRUBY_OPTS='--dev'
# workaround for PUP-10683
sudo apt remove rpm
# Larger spec groups mean fewer JVM boots (23 -> ~4), each of
# which costs startup plus ~19s of requires.
bundle exec rake "parallel:spec[$(nproc),6000]"
else
bundle exec rake parallel:spec
fi
rake_checks:
name: AIO Package Rake Checks
runs-on: ubuntu-24.04
steps:
# needs fetch-depth because the packaging dem reads old git tags
- name: Checkout current PR
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Install Ruby version 3.3
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
with:
ruby-version: 3.3
bundler-cache: true
- name: Validate code
run: |
bundle exec rake rubocop
bundle exec rake -T | grep vox:build
bundle exec rake -T | grep vox:upload
working-directory: packaging
tests:
if: always()
needs:
- checks
- rspec_tests
- rake_checks
runs-on: ubuntu-24.04
name: Test suite
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}