-
Notifications
You must be signed in to change notification settings - Fork 253
249 lines (207 loc) · 8.97 KB
/
ci.yml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: CI
on:
push:
pull_request:
schedule:
- cron: '30 20 * * *'
jobs:
build-installer:
strategy:
fail-fast: false
matrix:
include:
- target_ruby: "3.3.6"
arch: "x86-msvcrt"
build_ruby: "3.1.6/x64"
run_mri_spec: v3_3_6
- target_ruby: "3.3.6"
arch: "x64-ucrt"
build_ruby: "3.1.6/x64"
run_mri_spec: v3_3_6
- target_ruby: "3.2.6"
arch: "x86-msvcrt"
build_ruby: "3.1.6/x64"
run_mri_spec: v3_2_6
- target_ruby: "3.2.6"
arch: "x64-ucrt"
build_ruby: "3.1.6/x64"
run_mri_spec: v3_2_6
- target_ruby: "3.1.6"
arch: "x86-msvcrt"
build_ruby: "3.0.7/x64"
run_mri_spec: v3_1_6
- target_ruby: "3.1.6"
arch: "x64-ucrt"
build_ruby: "3.0.7/x64"
run_mri_spec: v3_1_6
- target_ruby: "3.0.7"
arch: "x86-msvcrt"
build_ruby: "3.1.6/x64"
run_mri_spec: v3_0_7
- target_ruby: "3.0.7"
arch: "x64-msvcrt"
build_ruby: "3.1.6/x64"
run_mri_spec: v3_0_7
- target_ruby: "head"
arch: "x64-ucrt"
build_ruby: "3.0.7/x64"
run_mri_spec: master
- target_ruby: "head"
arch: "x86-msvcrt"
build_ruby: "3.0.7/x64"
run_mri_spec: master
runs-on: windows-latest
env:
arch: ${{ matrix.arch }}
target_ruby: ${{ matrix.target_ruby }}
run_mri_spec: ${{ matrix.run_mri_spec }}
run_ruby_spec: ${{ matrix.run_ruby_spec }}
PATH: C:/hostedtoolcache/windows/Ruby/${{ matrix.build_ruby }}/bin;c:/Program Files/Git/cmd;c:/Program Files (x86)/Inno Setup 6;c:/Windows/system32;C:/Windows/System32/WindowsPowerShell/v1.0
steps:
- name: configure git crlf
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- uses: actions/checkout@v4
# Work around issue https://github.com/actions/checkout/issues/290
- name: fetch tag annotations
run: git fetch --force --tags
- run: ruby --version
- name: extract GIT_REF_TAG
shell: cmd
run: ruby -e 'ENV["GITHUB_REF"].sub(/refs\/tags\/(.*)/){ puts "GIT_REF_TAG="+$1 }' >>%GITHUB_ENV%
- name: show GIT_REF_TAG
shell: cmd
run: |
echo "%GIT_REF_TAG%"
git tag -l "%GIT_REF_TAG%" "--format=%%(subject)"
git tag -l "%GIT_REF_TAG%" "--format=%%(body)"
- name: stop build not required for release
shell: cmd
run: |
IF DEFINED GIT_REF_TAG (
echo.%GIT_REF_TAG% | findstr /C:"%target_ruby%">nul || (echo stop build not required for release & (exit 1))
)
- name: enable long paths on OS level
shell: powershell
# https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell
run: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: ensure bundler is installed on the build ruby
run: gem install bundler --conservative --no-doc
- name: Install alternative ruby
if: matrix.arch == 'x64-msvcrt' || matrix.arch == 'x64-ucrt'
shell: powershell
run: |
$(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.9-1/rubyinstaller-2.5.9-1-x86.exe", "$pwd/ruby-setup.exe")
cmd /c ruby-setup.exe /verysilent
- name: Install alternative ruby
if: matrix.arch == 'x86-msvcrt'
shell: powershell
run: |
$(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.10-1/rubyinstaller-2.4.10-1-x64.exe", "$pwd/ruby-setup.exe")
cmd /c ruby-setup.exe /verysilent
- name: workaround signature issue on github actions
shell: cmd
run: C:\msys64\usr\bin\sed -i "/^SigLevel/ s/$/ DatabaseOptional/" /etc/pacman.conf
- name: Kill all running msys2 binaries to avoid error "size of shared memory region changed".
shell: powershell
# See https://github.com/msys2/MSYS2-packages/issues/258
run: Get-Process | Where-Object {$_.path -like 'C:\msys64*'} | Stop-Process
- name: Build the installer
shell: cmd
run: rake ri:ruby-%target_ruby%-%arch% & c:/msys64/usr/bin/gpgconf --homedir /etc/pacman.d/gnupg --kill all
- name: Reuse installed ruby for RubyInstaller-Devkit
shell: cmd
run: |
c:/msys64/usr/bin/mkdir -p packages/ri-msys/recipes/
c:/msys64/usr/bin/cp -a packages/ri/recipes/unpack packages/ri-msys/recipes/
- name: Build the RubyInstaller-Devkit installer
shell: cmd
run: rake ri-msys:ruby-%target_ruby%-%arch%:installer-inno
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: installer-${{ matrix.target_ruby }}-${{ matrix.arch }}
path: |
packages/ri/recipes/archive-7z/*.7z
packages/ri/recipes/installer-inno/*.exe
packages/ri-msys/recipes/installer-inno/*.exe
- name: Run the built Ruby installer and install to c:/ri2-ruby
shell: cmd
run: ruby -e "Dir['packages/ri-msys/recipes/installer-inno/rubyinstaller-devkit-%target_ruby%*.exe'].each{|f| system(f, '/verysilent', '/currentuser', '/dir=c:/ri2-ruby', '/tasks=assocfiles,modpath,defaultutf8')}"
- name: Activate the environment variables set by the installer
# but exclude git's /usr/bin, because it conflicts with one RubyInstaller test.
shell: powershell
run: |
$env:PATH = [Environment]::GetEnvironmentVariable("PATH","Machine") -replace ";C:\\Program Files\\Git\\usr\\bin" -replace ";C:\\Ruby193\\bin"
$env:RUBYOPT = [Environment]::GetEnvironmentVariable("RUBYOPT","Machine")
echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RUBYOPT=$env:RUBYOPT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Verify PATH
shell: cmd
run: |
echo %PATH%
echo %RUBYOPT%
- name: ridk version
run: ridk version
- name: ridk install
run: ridk install 1 3
- name: create MSYS2 home dir for ruby-spec
shell: cmd
run: ridk exec sh -c "mkdir -pv ~"
- name: Install dependent gems
shell: cmd
run: |
IF "%target_ruby%" LSS "2.6" ( gem update --system && gem install bundler --force )
IF "%target_ruby%" GEQ "3.0" ( gem install webrick --conservative )
- name: Remove lock file because bundler version can vary between build and runtime
shell: cmd
run: del Gemfile.lock
- run: bundle install
- name: Install libstdc++ for 'rake test'
shell: cmd
run: ridk exec sh -c "pacman --noconfirm --sync --needed ${MINGW_PACKAGE_PREFIX}-gcc-libs"
- name: Run all tests against the new installed Ruby
shell: cmd
run: |
chcp 437
ridk exec rake test
- name: Run upload to github (only on tag builds)
shell: cmd
env:
GPGPASSWD: ${{ secrets.GPGPASSWD }}
DEPLOY_REPO_NAME: oneclick/rubyinstaller2
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
call ridk enable
set DEPLOY_TAG=%GIT_REF_TAG%
IF "%target_ruby%" EQU "head" (SET DEPLOY_TAG=rubyinstaller-head)
rake release:appveyor_upload -- packages/ri/recipes/installer-inno/%DEPLOY_TAG%*.exe packages/ri/recipes/archive-7z/%DEPLOY_TAG%*.7z packages/ri-msys/recipes/installer-inno/ruby*-%target_ruby%*.exe
- name: Run the Ruby Spec Suite
shell: pwsh
run: |
# 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")
ridk enable
if (-not ([string]::IsNullOrWhiteSpace($env:run_ruby_spec))) {
git clone --depth 1 https://github.com/ruby/mspec &&
git clone --depth 1 https://github.com/ruby/spec &&
env --unset=RUBYOPT ruby -C spec ../mspec/bin/mspec -I../../tool/lib -j
}
- name: Run the MRI copy of Ruby Spec Suite
shell: pwsh
run: |
# 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")
ridk enable
if (-not ([string]::IsNullOrWhiteSpace($env:run_mri_spec))) {
git clone --depth 1 https://github.com/ruby/ruby -b $env:run_mri_spec &&
env --unset=RUBYOPT ruby -C ruby/spec/ruby ../mspec/bin/mspec -I../../tool/lib -j
}
- name: Verify that the used CA list is still the latest.
shell: cmd
run: rake ssl:update_check || (rake ssl:update && git diff)