Skip to content

Commit 9ce1379

Browse files
committed
CI build against native Ruby v2.7
1 parent 4f80563 commit 9ce1379

File tree

1 file changed

+143
-1
lines changed

1 file changed

+143
-1
lines changed

.github/workflows/ci.yml

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,80 @@ jobs:
166166
paths: "test/reports/TEST-*.xml"
167167
if: always()
168168

169+
# only used for Ruby v2.7 as rake-compiler-dock dropped support for Ruby v2.7
170+
# and therefore we cannot build and test a native gem against this version
171+
test-windows-native:
172+
needs:
173+
- cross-compile
174+
175+
name: test-windows-native
176+
runs-on: windows-latest
177+
steps:
178+
- uses: actions/checkout@v4
179+
180+
- uses: ruby/setup-ruby@v1
181+
with:
182+
ruby-version: "2.7"
183+
bundler-cache: true
184+
185+
- name: Write used versions into file
186+
run: bundle exec rake ports:version_file
187+
188+
- name: Write used versions into file
189+
shell: pwsh
190+
run: bundle exec rake ports:version_file[x86_64-linux-gnu]
191+
192+
- name: Cache ports
193+
uses: actions/cache@v4
194+
with:
195+
path: ports
196+
key: cross-compiled-v1-x86_64-linux-gnu-${{ hashFiles('**/.ports_versions') }}
197+
restore-keys: |
198+
cross-compiled-v1-x86_64-linux-gnu-${{ hashFiles('**/.ports_versions') }}
199+
cross-compiled-v1-x86_64-linux-gnu-
200+
201+
- name: Build required libraries
202+
shell: pwsh
203+
run: |
204+
bundle exec rake ports
205+
206+
- name: Build gem
207+
shell: pwsh
208+
run: |
209+
bundle exec rake build
210+
211+
- name: Setup MSSQL
212+
uses: rails-sqlserver/setup-mssql@v1
213+
with:
214+
components: sqlcmd,sqlengine
215+
version: ${{ matrix.mssql-version }}
216+
sa-password: c0MplicatedP@ssword
217+
force-encryption: ${{ matrix.force-encryption }}
218+
219+
- name: Setup MSSQL database
220+
shell: pwsh
221+
run: |
222+
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
223+
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql
224+
225+
- name: Install toxiproxy-server
226+
shell: pwsh
227+
run: |
228+
choco install toxiproxy-server --version=2.5.0 -y
229+
Start-Process toxiproxy-server
230+
231+
- name: Test gem
232+
shell: pwsh
233+
run: bundle exec rake test
234+
env:
235+
TOXIPROXY_HOST: "localhost"
236+
237+
- name: Test Summary
238+
uses: test-summary/action@v2
239+
with:
240+
paths: "test/reports/TEST-*.xml"
241+
if: always()
242+
169243
install-windows-ucrt:
170244
needs:
171245
- cross-compile
@@ -292,7 +366,7 @@ jobs:
292366
fail-fast: false
293367
matrix:
294368
ruby-version:
295-
# currently fails with a dependency resolution
369+
# currently fails with a dependency resolution
296370
# looking for conflicting packages...
297371
# :: installing mingw-w64-x86_64-gcc-libs (15.1.0-8) breaks dependency 'mingw-w64-x86_64-gcc-libs=14.2.0-3' required by mingw-w64-x86_64-gcc
298372
# - "2.7"
@@ -472,6 +546,74 @@ jobs:
472546
paths: "test/reports/TEST-*.xml"
473547
if: always()
474548

549+
# only used for Ruby v2.7 as rake-compiler-dock dropped support for Ruby v2.7
550+
# and therefore we cannot build and test a native gem against this version
551+
test-linux-native:
552+
name: test-linux-native
553+
needs:
554+
- cross-compile
555+
runs-on: ubuntu-22.04
556+
steps:
557+
- uses: actions/checkout@v4
558+
559+
- uses: ruby/setup-ruby@v1
560+
with:
561+
ruby-version: "2.7"
562+
bundler-cache: true
563+
564+
- name: Write used versions into file
565+
run: bundle exec rake ports:version_file
566+
567+
- name: Write used versions into file
568+
shell: bash
569+
run: bundle exec rake ports:version_file[x86_64-linux-gnu]
570+
571+
- name: Cache ports
572+
uses: actions/cache@v4
573+
with:
574+
path: ports
575+
key: cross-compiled-v1-x86_64-linux-gnu-${{ hashFiles('**/.ports_versions') }}
576+
restore-keys: |
577+
cross-compiled-v1-x86_64-linux-gnu-${{ hashFiles('**/.ports_versions') }}
578+
cross-compiled-v1-x86_64-linux-gnu-
579+
580+
- name: Build required libraries
581+
run: |
582+
bundle exec rake ports
583+
584+
- name: Build gem
585+
run: |
586+
bundle exec rake build
587+
588+
- name: Setup MSSQL
589+
uses: rails-sqlserver/setup-mssql@v1
590+
with:
591+
components: sqlcmd,sqlengine
592+
version: ${{ matrix.mssql-version }}
593+
sa-password: "c0MplicatedP@ssword"
594+
595+
- name: Setup MSSQL database
596+
run: |
597+
sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
598+
sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql
599+
600+
- name: Install toxiproxy-server
601+
run: |
602+
wget -O toxiproxy-2.5.0.deb https://github.com/Shopify/toxiproxy/releases/download/v2.5.0/toxiproxy_2.5.0_linux_amd64.deb
603+
sudo dpkg -i toxiproxy-2.5.0.deb
604+
sudo toxiproxy-server &
605+
606+
- name: Run tests
607+
run: bundle exec rake test
608+
env:
609+
TOXIPROXY_HOST: "localhost"
610+
611+
- name: Test Summary
612+
uses: test-summary/action@v2
613+
with:
614+
paths: "test/reports/TEST-*.xml"
615+
if: always()
616+
475617
install-linux-native:
476618
strategy:
477619
fail-fast: false

0 commit comments

Comments
 (0)