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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions .github/workflows/sqlite3-ruby.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# for Actions OS info, see https://github.com/actions/runner-images#available-images

name: test suite
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
Expand All @@ -20,27 +22,17 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-2022"]
os: [ubuntu-latest, macos-latest, windows-2022]
# use quotes for versions, otherwise "3.0" -> "3", "2.10" -> "2.1"
ruby: ["3.1", "3.0", "2.7", "2.6"]
lib: ["system", "packaged"]
lib: [system, packaged]
include:
- os: "ubuntu-latest"
ruby: "truffleruby-head"
- os: "ubuntu-latest"
ruby: "head"
- os: "windows-2022"
ruby: "mingw"
sys: "enable"
- os: "windows-2022"
ruby: "mingw"
sys: "disable"
- os: "windows-2022"
ruby: "mswin"
sys: "enable"
- lib: "system"
sys: "enable"
- lib: "packaged"
sys: "disable"
- { os: ubuntu-latest, ruby: truffleruby-head, lib: packaged }
- { os: ubuntu-22.04 , ruby: head , lib: packaged }
- { os: ubuntu-22.04 , ruby: head , lib: system }
- { os: windows-2022 , ruby: ucrt , lib: system }
- { os: windows-2022 , ruby: mswin , lib: system }

runs-on: ${{matrix.os}}
steps:
- if: matrix.os == 'windows-2022'
Expand All @@ -53,16 +45,25 @@ jobs:
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
apt-get: "libsqlite3-dev"
brew: "sqlite3"
mingw: "sqlite3"
vcpkg: "sqlite3"
apt-get: libsqlite3-dev
brew: sqlite3
mingw: sqlite3
vcpkg: sqlite3
- if: matrix.lib == 'packaged'
uses: actions/cache@v3
with:
path: ports
key: ports-${{matrix.os}}-${{hashFiles('ext/sqlite3/extconf.rb')}}
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries

- run: bundle exec rake compile -- --disable-system-libraries
if: matrix.lib == 'packaged'

- run: bundle exec rake compile -- --enable-system-libraries
if: matrix.lib == 'system' && !startsWith(matrix.os, 'macos')

- run: bundle exec rake compile -- --enable-system-libraries --with-opt-dir=$(brew --prefix sqlite3)
if: matrix.lib == 'system' && startsWith(matrix.os, 'macos')

- run: bundle exec rake test

old_sqlite3:
Expand All @@ -79,13 +80,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-2022"]
os: [ubuntu-latest, macos-latest, windows-2022]
# use quotes for versions, otherwise "3.0" -> "3", "2.10" -> "2.1"
ruby: ["3.1", "2.6"] # oldest and newest
include:
- os: "windows-2022"
ruby: "mingw"
- os: "windows-2022"
ruby: "mswin"
- { os: windows-2022, ruby: mingw }
- { os: windows-2022, ruby: mswin }
runs-on: ${{matrix.os}}
steps:
- if: matrix.os == 'windows-2022'
Expand All @@ -98,9 +98,9 @@ jobs:
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
apt-get: "libsqlcipher-dev"
brew: "sqlcipher"
mingw: "sqlcipher"
vcpkg: "sqlcipher"
apt-get: libsqlcipher-dev
brew: sqlcipher
mingw: sqlcipher
vcpkg: sqlcipher
- run: bundle exec rake compile -- --with-sqlcipher
- run: bundle exec rake test
4 changes: 4 additions & 0 deletions test/test_sqlite3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ def test_version_strings
skip if SQLite3::VERSION.include?("test") # see set-version-to-timestamp rake task
assert_equal(SQLite3::VERSION, SQLite3::VersionProxy::STRING)
end

def test_compiled_version_and_loaded_version
assert_equal(SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION)
end
end
end