Skip to content

Commit d6b9318

Browse files
authored
Merge pull request #594 from andyundso/v4-first-steps
v4: First steps
2 parents 0737149 + 6239d74 commit d6b9318

File tree

15 files changed

+28
-263
lines changed

15 files changed

+28
-263
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/ruby:2.7
1+
FROM mcr.microsoft.com/devcontainers/ruby:3.2
22

33
# Install the SQL Server command-line tools and the Artistic Style code formatter
44
RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc \
@@ -8,7 +8,7 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/t
88
ENV PATH=$PATH:/opt/mssql-tools18/bin
99

1010
# Install FreeTDS
11-
ENV FREETDS_VERSION=1.5.1
11+
ENV FREETDS_VERSION=1.5.4
1212
COPY test/bin/install-freetds.sh /tmp/
1313
RUN /tmp/install-freetds.sh
1414

.github/workflows/ci.yml

Lines changed: 4 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
platform:
14-
- "x64-mingw32"
1514
- "x64-mingw-ucrt"
1615
- "x86_64-linux-gnu"
1716
- "x86_64-linux-musl"
@@ -26,7 +25,7 @@ jobs:
2625
- name: Set up Ruby
2726
uses: ruby/setup-ruby@v1
2827
with:
29-
ruby-version: "2.7"
28+
ruby-version: "3.2"
3029

3130
- name: "Install dependencies"
3231
run: bundle install
@@ -53,129 +52,13 @@ jobs:
5352
name: gem-${{ matrix.platform }}
5453
path: pkg/*.gem
5554

56-
install-windows-mingw:
57-
needs:
58-
- cross-compile
59-
strategy:
60-
fail-fast: false
61-
matrix:
62-
ruby-version:
63-
- "2.7"
64-
- "3.0"
65-
66-
name: install-windows-mingw
67-
runs-on: windows-latest
68-
steps:
69-
- uses: ruby/setup-ruby@v1
70-
with:
71-
ruby-version: ${{ matrix.ruby-version }}
72-
bundler-cache: true
73-
74-
- name: Download precompiled gem
75-
uses: actions/download-artifact@v4
76-
with:
77-
name: gem-x64-mingw32
78-
79-
- name: Install native gem
80-
shell: pwsh
81-
run: gem install "tiny_tds-*.gem"
82-
83-
- name: Test if TinyTDS loads
84-
shell: pwsh
85-
run: |
86-
ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
87-
exit $LASTEXITCODE
88-
89-
- name: Test if tsql wrapper works
90-
shell: pwsh
91-
run: |
92-
tsql-ttds -C
93-
exit $LASTEXITCODE
94-
95-
- name: Test if defncopy wrapper works
96-
shell: pwsh
97-
run: |
98-
defncopy-ttds -v
99-
exit $LASTEXITCODE
100-
101-
test-windows-mingw:
102-
needs:
103-
- cross-compile
104-
strategy:
105-
fail-fast: false
106-
matrix:
107-
force-encryption:
108-
- false
109-
- true
110-
mssql-version:
111-
- 2017
112-
- 2019
113-
- 2022
114-
ruby-version:
115-
- "2.7"
116-
- "3.0"
117-
118-
name: test-windows-mingw
119-
runs-on: windows-latest
120-
steps:
121-
- uses: actions/checkout@v4
122-
123-
- uses: ruby/setup-ruby@v1
124-
with:
125-
ruby-version: ${{ matrix.ruby-version }}
126-
bundler-cache: true
127-
128-
- name: Download precompiled gem
129-
uses: actions/download-artifact@v4
130-
with:
131-
name: gem-x64-mingw32
132-
133-
- name: Install native gem and restore cross-compiled code from it
134-
shell: pwsh
135-
run: "& ./test/bin/restore-from-native-gem.ps1"
136-
env:
137-
RUBY_ARCHITECTURE: "x64-mingw32"
138-
139-
- name: Setup MSSQL
140-
uses: rails-sqlserver/setup-mssql@v1
141-
with:
142-
components: sqlcmd,sqlengine
143-
version: ${{ matrix.mssql-version }}
144-
sa-password: c0MplicatedP@ssword
145-
force-encryption: ${{ matrix.force-encryption }}
146-
147-
- name: Setup MSSQL database
148-
shell: pwsh
149-
run: |
150-
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
151-
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql
152-
153-
- name: Install toxiproxy-server
154-
shell: pwsh
155-
run: |
156-
choco install toxiproxy-server --version=2.5.0 -y
157-
Start-Process toxiproxy-server
158-
159-
- name: Test gem
160-
shell: pwsh
161-
run: bundle exec rake test
162-
env:
163-
TOXIPROXY_HOST: "localhost"
164-
165-
- name: Test Summary
166-
uses: test-summary/action@v2
167-
with:
168-
paths: "test/reports/TEST-*.xml"
169-
if: always()
170-
17155
install-windows-ucrt:
17256
needs:
17357
- cross-compile
17458
strategy:
17559
fail-fast: false
17660
matrix:
17761
ruby-version:
178-
- "3.1"
17962
- "3.2"
18063
- "3.3"
18164
- "3.4"
@@ -225,11 +108,9 @@ jobs:
225108
- false
226109
- true
227110
mssql-version:
228-
- 2017
229111
- 2019
230112
- 2022
231113
ruby-version:
232-
- "3.1"
233114
- "3.2"
234115
- "3.3"
235116
- "3.4"
@@ -256,7 +137,7 @@ jobs:
256137
RUBY_ARCHITECTURE: "x64-mingw-ucrt"
257138

258139
- name: Setup MSSQL
259-
uses: rails-sqlserver/setup-mssql@v1
140+
uses: rails-sqlserver/setup-mssql@v2
260141
with:
261142
components: sqlcmd,sqlengine
262143
version: ${{ matrix.mssql-version }}
@@ -292,12 +173,6 @@ jobs:
292173
fail-fast: false
293174
matrix:
294175
ruby-version:
295-
# currently fails with a dependency resolution
296-
# looking for conflicting packages...
297-
# :: 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
298-
# - "2.7"
299-
# - "3.0"
300-
# - "3.1"
301176
- "3.2"
302177
- "3.3"
303178
- "3.4"
@@ -353,25 +228,20 @@ jobs:
353228
- "aarch64-linux-musl"
354229

355230
ruby-version:
356-
- "2.7"
357-
- "3.0"
358-
- "3.1"
359231
- "3.2"
360232
- "3.3"
361233
- "3.4"
362234

363235
include:
364236
- platform: x86_64-linux-musl
365237
docker_tag: "-alpine"
366-
bootstrap: "apk add -U build-base &&" # required to compile bigdecimal on Ruby 2.7
367238

368239
- platform: aarch64-linux-gnu
369240
docker_platform: "--platform=linux/arm64"
370241

371242
- platform: aarch64-linux-musl
372243
docker_platform: "--platform=linux/arm64"
373244
docker_tag: "-alpine"
374-
bootstrap: "apk add -U build-base &&"
375245

376246
name: install-linux
377247
runs-on: ubuntu-22.04
@@ -414,9 +284,6 @@ jobs:
414284
- 2022
415285

416286
ruby-version:
417-
- "2.7"
418-
- "3.0"
419-
- "3.1"
420287
- "3.2"
421288
- "3.3"
422289
- "3.4"
@@ -442,7 +309,7 @@ jobs:
442309
RUBY_ARCHITECTURE: "x86_64-linux-gnu"
443310

444311
- name: Setup MSSQL
445-
uses: rails-sqlserver/setup-mssql@v1
312+
uses: rails-sqlserver/setup-mssql@v2
446313
with:
447314
components: sqlcmd,sqlengine
448315
version: ${{ matrix.mssql-version }}
@@ -476,9 +343,6 @@ jobs:
476343
fail-fast: false
477344
matrix:
478345
ruby-version:
479-
- "2.7"
480-
- "3.0"
481-
- "3.1"
482346
- "3.2"
483347
- "3.3"
484348
- "3.4"
@@ -522,9 +386,6 @@ jobs:
522386
fail-fast: false
523387
matrix:
524388
ruby-version:
525-
- "2.7"
526-
- "3.0"
527-
- "3.1"
528389
- "3.2"
529390
- "3.3"
530391
- "3.4"
@@ -566,7 +427,7 @@ jobs:
566427

567428
- uses: ruby/setup-ruby@v1
568429
with:
569-
ruby-version: "2.7"
430+
ruby-version: "3.2"
570431
bundler-cache: true
571432

572433
- name: Check standardrb

.rubocop.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## (unreleased)
22

3+
* Drop support for Ruby < 3.2
4+
* Drop support for SQL Server < 2019
5+
36
## 3.3.0
47

58
* Use freetds v1.5.4 and OpenSSL v3.5.2 for Windows and Linux builds.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The API is simple and consists of these classes:
1818

1919
## Install
2020

21-
tiny_tds is tested with Ruby v2.7 and upwards.
21+
tiny_tds is tested with Ruby v3.2 and upwards.
2222

2323
### Windows and Linux (64-bit)
2424

@@ -413,13 +413,14 @@ From within the container, you can run the tests using the following command:
413413

414414
```shell
415415
bundle install
416+
bundle exec rake compile
416417
bundle exec rake test
417418
```
418419

419420
You can customize the environment variables to run the tests against a different environment
420421

421422
```shell
422-
rake test TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2017
423+
rake test TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2019
423424
rake test TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
424425
```
425426

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ SPEC = Gem::Specification.load(File.expand_path("../tiny_tds.gemspec", __FILE__)
88
CrossLibrary = Struct.new :platform, :openssl_config
99
CrossLibraries = [
1010
["x64-mingw-ucrt", "mingw64"],
11-
["x64-mingw32", "mingw64"],
1211
["x86_64-linux-gnu", "linux-x86_64"],
1312
["x86_64-linux-musl", "linux-x86_64"],
1413
["aarch64-linux-gnu", "linux-aarch64"],

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0
1+
4.0.0

ext/tiny_tds/extconf.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,11 @@ def configure_defaults
140140
/usr/local
141141
]
142142

143-
if /darwin/i.match?(RbConfig::CONFIG["host_os"])
144-
# Ruby below 2.7 seems to label the host CPU on Apple Silicon as aarch64
145-
# 2.7 and above print is as ARM64
146-
target_host_cpu = (Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")) ? "aarch64" : "arm64"
147-
148-
if RbConfig::CONFIG["host_cpu"] == target_host_cpu
149-
# Homebrew on Apple Silicon installs into /opt/hombrew
150-
# https://docs.brew.sh/Installation
151-
# On Intel Macs, it is /usr/local, so no changes necessary to DIRS
152-
DIRS.unshift("/opt/homebrew")
153-
end
143+
# Homebrew on Apple Silicon installs into /opt/hombrew
144+
# https://docs.brew.sh/Installation
145+
# On Intel Macs, it is /usr/local, so no changes necessary to DIRS
146+
if /darwin/i.match?(RbConfig::CONFIG["host_os"]) && RbConfig::CONFIG["host_cpu"] == "arm64"
147+
DIRS.unshift("/opt/homebrew")
154148
end
155149

156150
if ENV["RI_DEVKIT"] && ENV["MINGW_PREFIX"] # RubyInstaller Support

0 commit comments

Comments
 (0)