-
Notifications
You must be signed in to change notification settings - Fork 41
143 lines (125 loc) · 4.45 KB
/
tests.yaml
File metadata and controls
143 lines (125 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
name: RSpec tests
on:
pull_request: {}
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@v6
- name: Install ruby version ${{ matrix.cfg.ruby }}
uses: ruby/setup-ruby@v1
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: 'jruby-9.4.8.0'}
- {os: ubuntu-24.04, ruby: 'jruby-9.4.14.0'}
- {os: windows-2025, ruby: '3.2'}
- {os: windows-2025, ruby: '3.3'}
- {os: windows-2025, ruby: '3.4'}
runs-on: ${{ matrix.cfg.os }}
steps:
- name: Checkout current PR
uses: actions/checkout@v6
- name: Install ruby version ${{ matrix.cfg.ruby }}
uses: ruby/setup-ruby@v1
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: |
# 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
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'
# workaround for PUP-10683
sudo apt remove rpm
fi
bundle exec rake parallel:spec
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@v6
with:
fetch-depth: 0
- name: Install Ruby version 3.3
uses: ruby/setup-ruby@v1
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) }}