Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/ruby:2.7
FROM mcr.microsoft.com/devcontainers/ruby:3.2

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

# Install FreeTDS
ENV FREETDS_VERSION=1.5.1
ENV FREETDS_VERSION=1.5.4
COPY test/bin/install-freetds.sh /tmp/
RUN /tmp/install-freetds.sh

Expand Down
147 changes: 4 additions & 143 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
fail-fast: false
matrix:
platform:
- "x64-mingw32"
- "x64-mingw-ucrt"
- "x86_64-linux-gnu"
- "x86_64-linux-musl"
Expand All @@ -26,7 +25,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.2"

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

install-windows-mingw:
needs:
- cross-compile
strategy:
fail-fast: false
matrix:
ruby-version:
- "2.7"
- "3.0"

name: install-windows-mingw
runs-on: windows-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Download precompiled gem
uses: actions/download-artifact@v4
with:
name: gem-x64-mingw32

- name: Install native gem
shell: pwsh
run: gem install "tiny_tds-*.gem"

- name: Test if TinyTDS loads
shell: pwsh
run: |
ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
exit $LASTEXITCODE

- name: Test if tsql wrapper works
shell: pwsh
run: |
tsql-ttds -C
exit $LASTEXITCODE

- name: Test if defncopy wrapper works
shell: pwsh
run: |
defncopy-ttds -v
exit $LASTEXITCODE

test-windows-mingw:
needs:
- cross-compile
strategy:
fail-fast: false
matrix:
force-encryption:
- false
- true
mssql-version:
- 2017
- 2019
- 2022
ruby-version:
- "2.7"
- "3.0"

name: test-windows-mingw
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Download precompiled gem
uses: actions/download-artifact@v4
with:
name: gem-x64-mingw32

- name: Install native gem and restore cross-compiled code from it
shell: pwsh
run: "& ./test/bin/restore-from-native-gem.ps1"
env:
RUBY_ARCHITECTURE: "x64-mingw32"

- name: Setup MSSQL
uses: rails-sqlserver/setup-mssql@v1
with:
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
sa-password: c0MplicatedP@ssword
force-encryption: ${{ matrix.force-encryption }}

- name: Setup MSSQL database
shell: pwsh
run: |
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql

- name: Install toxiproxy-server
shell: pwsh
run: |
choco install toxiproxy-server --version=2.5.0 -y
Start-Process toxiproxy-server

- name: Test gem
shell: pwsh
run: bundle exec rake test
env:
TOXIPROXY_HOST: "localhost"

- name: Test Summary
uses: test-summary/action@v2
with:
paths: "test/reports/TEST-*.xml"
if: always()

install-windows-ucrt:
needs:
- cross-compile
strategy:
fail-fast: false
matrix:
ruby-version:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -225,11 +108,9 @@ jobs:
- false
- true
mssql-version:
- 2017
- 2019
- 2022
ruby-version:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand All @@ -256,7 +137,7 @@ jobs:
RUBY_ARCHITECTURE: "x64-mingw-ucrt"

- name: Setup MSSQL
uses: rails-sqlserver/setup-mssql@v1
uses: rails-sqlserver/setup-mssql@v2
with:
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
Expand Down Expand Up @@ -292,12 +173,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
# currently fails with a dependency resolution
# looking for conflicting packages...
# :: 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
# - "2.7"
# - "3.0"
# - "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -353,25 +228,20 @@ jobs:
- "aarch64-linux-musl"

ruby-version:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"

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

- platform: aarch64-linux-gnu
docker_platform: "--platform=linux/arm64"

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

name: install-linux
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -414,9 +284,6 @@ jobs:
- 2022

ruby-version:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand All @@ -442,7 +309,7 @@ jobs:
RUBY_ARCHITECTURE: "x86_64-linux-gnu"

- name: Setup MSSQL
uses: rails-sqlserver/setup-mssql@v1
uses: rails-sqlserver/setup-mssql@v2
with:
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
Expand Down Expand Up @@ -476,9 +343,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -522,9 +386,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -566,7 +427,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.2"
bundler-cache: true

- name: Check standardrb
Expand Down
31 changes: 0 additions & 31 deletions .rubocop.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## (unreleased)

* Drop support for Ruby < 3.2
* Drop support for SQL Server < 2019

## 3.3.0

* Use freetds v1.5.4 and OpenSSL v3.5.2 for Windows and Linux builds.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The API is simple and consists of these classes:

## Install

tiny_tds is tested with Ruby v2.7 and upwards.
tiny_tds is tested with Ruby v3.2 and upwards.

### Windows and Linux (64-bit)

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

```shell
bundle install
bundle exec rake compile
bundle exec rake test
```

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

```shell
rake test TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2017
rake test TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2019
rake test TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
```

Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ SPEC = Gem::Specification.load(File.expand_path("../tiny_tds.gemspec", __FILE__)
CrossLibrary = Struct.new :platform, :openssl_config
CrossLibraries = [
["x64-mingw-ucrt", "mingw64"],
["x64-mingw32", "mingw64"],
["x86_64-linux-gnu", "linux-x86_64"],
["x86_64-linux-musl", "linux-x86_64"],
["aarch64-linux-gnu", "linux-aarch64"],
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0
4.0.0
16 changes: 5 additions & 11 deletions ext/tiny_tds/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,11 @@ def configure_defaults
/usr/local
]

if /darwin/i.match?(RbConfig::CONFIG["host_os"])
# Ruby below 2.7 seems to label the host CPU on Apple Silicon as aarch64
# 2.7 and above print is as ARM64
target_host_cpu = (Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")) ? "aarch64" : "arm64"

if RbConfig::CONFIG["host_cpu"] == target_host_cpu
# Homebrew on Apple Silicon installs into /opt/hombrew
# https://docs.brew.sh/Installation
# On Intel Macs, it is /usr/local, so no changes necessary to DIRS
DIRS.unshift("/opt/homebrew")
end
# Homebrew on Apple Silicon installs into /opt/hombrew
# https://docs.brew.sh/Installation
# On Intel Macs, it is /usr/local, so no changes necessary to DIRS
if /darwin/i.match?(RbConfig::CONFIG["host_os"]) && RbConfig::CONFIG["host_cpu"] == "arm64"
DIRS.unshift("/opt/homebrew")
end

if ENV["RI_DEVKIT"] && ENV["MINGW_PREFIX"] # RubyInstaller Support
Expand Down
Loading
Loading