forked from larsch/ocra
-
Notifications
You must be signed in to change notification settings - Fork 8
174 lines (149 loc) · 4.9 KB
/
test-on-push.yml
File metadata and controls
174 lines (149 loc) · 4.9 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
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
name: Run Tests
on:
push:
branches:
- '*'
jobs:
run-tests-linux:
strategy:
fail-fast: false
matrix:
#ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: ['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
run: |
bundle exec rake build
bundle exec rake test
- name: Build zlib fixture for cross-distro test
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 -v /tmp:/mnt debian:stable-slim /mnt/zlib_packed
run-tests-macos:
strategy:
fail-fast: false
matrix:
#ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: ['4.0']
runs-on: macos-latest
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.ruby }}
path: zlib_packed
retention-days: 1
test-macos-portability:
needs: run-tests-macos
strategy:
fail-fast: false
matrix:
#ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: ['4.0']
runs-on: macos-latest
steps:
- name: Download packed binary
uses: actions/download-artifact@v4
with:
name: zlib-macos-${{ matrix.ruby }}
- name: Run packed executable
run: |
chmod +x zlib_packed
./zlib_packed
run-tests-windows:
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
#ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: ['4.0']
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:
ruby: ['4.0']
runs-on: windows-latest
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