-
Notifications
You must be signed in to change notification settings - Fork 189
257 lines (235 loc) · 8.64 KB
/
binary-gems.yml
File metadata and controls
257 lines (235 loc) · 8.64 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
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
250
251
252
253
254
255
256
257
name: Binary gems
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * 3" # At 05:00 on Wednesday # https://crontab.guru/#0_5_*_*_3
push:
branches:
- master
tags:
- "*.*.*"
pull_request:
types: [opened, synchronize]
branches:
- "*"
permissions:
contents: read
jobs:
rcd_build:
name: Build
runs-on: ubuntu-latest
# env:
# RCD_IMAGE_VERSION: snapshot
strategy:
fail-fast: false
matrix:
include:
- platform: "x64-mingw-ucrt"
- platform: "x64-mingw32"
- platform: "x86_64-linux"
- platform: "x86_64-linux-musl"
- platform: "aarch64-linux"
- platform: "aarch64-linux-musl"
- platform: "x86_64-darwin"
- platform: "arm64-darwin"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- run: bundle install
- name: Create a dummy cert to satisfy the build
run: |
mkdir -p ~/.gem/
ruby -ropenssl -e "puts OpenSSL::PKey::RSA.new(2048).to_pem" > ~/.gem/gem-private_key.pem
gem cert --build travis-ci@dummy.org --private-key ~/.gem/gem-private_key.pem
cp gem-public_cert.pem ~/.gem/gem-public_cert.pem
- name: Build binary gem
run: bundle exec rake gem:native:${{ matrix.platform }}
- name: Upload binary gem
uses: actions/upload-artifact@v4
with:
name: binary-gem-${{ matrix.platform }}
path: pkg/*.gem
job_test_binary:
name: Test
needs: rcd_build
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
ruby: "4.0"
platform: "x64-mingw-ucrt"
- os: windows-latest
ruby: "3.2"
platform: "x64-mingw-ucrt"
PGVERSION: 16.6-1-windows-x64
- os: ubuntu-latest
ruby: "4.0"
platform: "x86_64-linux"
- os: ubuntu-latest
ruby: "3.0"
platform: "x86_64-linux"
- os: ubuntu-24.04-arm
ruby: "4.0"
platform: "aarch64-linux"
- os: ubuntu-24.04-arm
ruby: "3.0"
platform: "aarch64-linux"
- os: macos-latest
ruby: "4.0"
platform: "arm64-darwin"
- os: macos-latest
ruby: "3.0"
platform: "arm64-darwin"
- os: macos-15-intel
ruby: "4.0"
platform: "x86_64-darwin"
- os: macos-15-intel
ruby: "3.0"
platform: "x86_64-darwin"
runs-on: ${{ matrix.os }}
env:
PGVERSION: ${{ matrix.PGVERSION }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
if: matrix.platform != 'x86-mingw32'
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: "postgresql" # Ubuntu
brew: "postgresql" # macOS
mingw: "postgresql" # Windows mingw / mswin /ucrt
- name: Set up 32 bit x86 Ruby
if: matrix.platform == 'x86-mingw32'
run: |
$(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${{ matrix.ruby }}/rubyinstaller-${{ matrix.ruby }}-x86.exe", "$pwd/ruby-setup.exe")
cmd /c ruby-setup.exe /currentuser /verysilent /dir=C:/Ruby-${{ matrix.ruby }}
echo "c:/ruby-${{ matrix.ruby }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
c:/ruby-${{ matrix.ruby }}/bin/ridk enable
c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed make `${MINGW_PACKAGE_PREFIX}-pkgconf `${MINGW_PACKAGE_PREFIX}-libyaml `${MINGW_PACKAGE_PREFIX}-gcc `${MINGW_PACKAGE_PREFIX}-make"
echo "C:/msys64/$env:MSYSTEM_PREFIX/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Download gem from build job
uses: actions/download-artifact@v4
with:
name: binary-gem-${{ matrix.platform }}
- run: bundle install
- run: gem install --local pg-*${{ matrix.platform }}.gem --verbose
- name: Download PostgreSQL
if: ${{ matrix.os == 'windows-latest' && matrix.PGVERSION }}
run: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Unzip {
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
$(new-object net.webclient).DownloadFile("http://get.enterprisedb.com/postgresql/postgresql-$env:PGVERSION-binaries.zip", "postgresql-binaries.zip")
Unzip "postgresql-binaries.zip" "."
echo "$pwd/pgsql/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: set PGUSER
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo "PGUSER=$env:USERNAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PGPASSWORD=" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- run: echo $env:PATH
- name: Run specs
if: ${{ matrix.os != 'windows-latest' }}
run: ruby -rpg -S rspec -fd spec/*_spec.rb spec/**/*_spec.rb
- name: Run specs
if: ${{ matrix.os == 'windows-latest' }}
run: |
ridk enable
ruby -rpg -S rspec -fd spec/*_spec.rb spec/**/*_spec.rb
- name: Print logs if job failed
if: ${{ failure() && matrix.os == 'windows-latest' }}
run: |
ridk enable
find "$(ruby -e"puts RbConfig::CONFIG[%q[libdir]]")" -name mkmf.log -print0 | xargs -0 cat
find -name setup.log -print0 | xargs -0 cat
job_binary_multiarch:
name: multiarch (${{matrix.gem_platform}} on ${{matrix.from_image}} ${{matrix.image_platform}})
needs: rcd_build
strategy:
fail-fast: false
matrix:
include:
- from_image: fedora:39
image_platform: linux/x86_64
gem_platform: x86_64-linux
dockerfile: centos
- from_image: alpine
image_platform: linux/x86_64
gem_platform: x86_64-linux-musl
dockerfile: alpine
- from_image: alpine
image_platform: linux/arm64
gem_platform: aarch64-linux-musl
dockerfile: alpine
os: ubuntu-24.04-arm
- from_image: alpine
image_platform: linux/x86_64
gem_platform: x86_64-linux
dockerfile: alpine
docker_arg: "--build-arg with_pkg=gcompat"
- from_image: alpine
image_platform: linux/arm64
gem_platform: aarch64-linux
dockerfile: alpine
docker_arg: "--build-arg with_pkg=gcompat"
os: ubuntu-24.04-arm
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- name: Download gem-${{ matrix.gem_platform }}
uses: actions/download-artifact@v4
with:
name: binary-gem-${{ matrix.gem_platform }}
- name: Build image and Run tests
run: |
docker build --rm --platform ${{matrix.image_platform}} --build-arg from_image=${{matrix.from_image}} ${{matrix.docker_arg}} -t ruby-test -f spec/env/Dockerfile.${{matrix.dockerfile}} .
docker run --rm -t --network=host -v `pwd`:/build ruby-test
job_binary_yugabyte:
name: yugabyte (${{matrix.gem_platform}}
needs: rcd_build
strategy:
fail-fast: false
matrix:
include:
- gem_platform: x86_64-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download gem-${{ matrix.gem_platform }}
uses: actions/download-artifact@v4
with:
name: binary-gem-${{ matrix.gem_platform }}
- name: Build image and Run tests
run: |
sudo apt-get install -y docker-compose
cp -v pg-*.gem misc/yugabyte/
cd misc/yugabyte
docker-compose up --abort-on-container-exit --exit-code-from pg
job_binary_too_old_glibc:
name: GLIBC
needs: rcd_build
strategy:
fail-fast: false
matrix:
include:
- gem_platform: x86_64-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download gem-${{ matrix.gem_platform }}
uses: actions/download-artifact@v4
with:
name: binary-gem-${{ matrix.gem_platform }}
- name: Build image and Run tests
run: |
sudo apt-get install -y docker-compose
cp -v pg-*.gem misc/glibc/
cd misc/glibc
docker-compose up --abort-on-container-exit --exit-code-from pg