Skip to content

Commit 28832a1

Browse files
authored
Merge pull request #336 from MSP-Greg/00-pr-333-test-versions
test: assert compiled and loaded versions of sqlite3 are the same, update sqlite3-ruby.yml
2 parents 94b7447 + a8bb084 commit 28832a1

2 files changed

Lines changed: 37 additions & 33 deletions

File tree

.github/workflows/sqlite3-ruby.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# for Actions OS info, see https://github.com/actions/runner-images#available-images
2+
13
name: test suite
24
concurrency:
35
group: "${{github.workflow}}-${{github.ref}}"
@@ -20,27 +22,17 @@ jobs:
2022
strategy:
2123
fail-fast: false
2224
matrix:
23-
os: ["ubuntu-latest", "macos-latest", "windows-2022"]
25+
os: [ubuntu-latest, macos-latest, windows-2022]
26+
# use quotes for versions, otherwise "3.0" -> "3", "2.10" -> "2.1"
2427
ruby: ["3.1", "3.0", "2.7", "2.6"]
25-
lib: ["system", "packaged"]
28+
lib: [system, packaged]
2629
include:
27-
- os: "ubuntu-latest"
28-
ruby: "truffleruby-head"
29-
- os: "ubuntu-latest"
30-
ruby: "head"
31-
- os: "windows-2022"
32-
ruby: "mingw"
33-
sys: "enable"
34-
- os: "windows-2022"
35-
ruby: "mingw"
36-
sys: "disable"
37-
- os: "windows-2022"
38-
ruby: "mswin"
39-
sys: "enable"
40-
- lib: "system"
41-
sys: "enable"
42-
- lib: "packaged"
43-
sys: "disable"
30+
- { os: ubuntu-latest, ruby: truffleruby-head, lib: packaged }
31+
- { os: ubuntu-22.04 , ruby: head , lib: packaged }
32+
- { os: ubuntu-22.04 , ruby: head , lib: system }
33+
- { os: windows-2022 , ruby: ucrt , lib: system }
34+
- { os: windows-2022 , ruby: mswin , lib: system }
35+
4436
runs-on: ${{matrix.os}}
4537
steps:
4638
- if: matrix.os == 'windows-2022'
@@ -53,16 +45,25 @@ jobs:
5345
with:
5446
ruby-version: ${{matrix.ruby}}
5547
bundler-cache: true
56-
apt-get: "libsqlite3-dev"
57-
brew: "sqlite3"
58-
mingw: "sqlite3"
59-
vcpkg: "sqlite3"
48+
apt-get: libsqlite3-dev
49+
brew: sqlite3
50+
mingw: sqlite3
51+
vcpkg: sqlite3
6052
- if: matrix.lib == 'packaged'
6153
uses: actions/cache@v3
6254
with:
6355
path: ports
6456
key: ports-${{matrix.os}}-${{hashFiles('ext/sqlite3/extconf.rb')}}
65-
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
57+
58+
- run: bundle exec rake compile -- --disable-system-libraries
59+
if: matrix.lib == 'packaged'
60+
61+
- run: bundle exec rake compile -- --enable-system-libraries
62+
if: matrix.lib == 'system' && !startsWith(matrix.os, 'macos')
63+
64+
- run: bundle exec rake compile -- --enable-system-libraries --with-opt-dir=$(brew --prefix sqlite3)
65+
if: matrix.lib == 'system' && startsWith(matrix.os, 'macos')
66+
6667
- run: bundle exec rake test
6768

6869
old_sqlite3:
@@ -79,13 +80,12 @@ jobs:
7980
strategy:
8081
fail-fast: false
8182
matrix:
82-
os: ["ubuntu-latest", "macos-latest", "windows-2022"]
83+
os: [ubuntu-latest, macos-latest, windows-2022]
84+
# use quotes for versions, otherwise "3.0" -> "3", "2.10" -> "2.1"
8385
ruby: ["3.1", "2.6"] # oldest and newest
8486
include:
85-
- os: "windows-2022"
86-
ruby: "mingw"
87-
- os: "windows-2022"
88-
ruby: "mswin"
87+
- { os: windows-2022, ruby: mingw }
88+
- { os: windows-2022, ruby: mswin }
8989
runs-on: ${{matrix.os}}
9090
steps:
9191
- if: matrix.os == 'windows-2022'
@@ -98,9 +98,9 @@ jobs:
9898
with:
9999
ruby-version: ${{matrix.ruby}}
100100
bundler-cache: true
101-
apt-get: "libsqlcipher-dev"
102-
brew: "sqlcipher"
103-
mingw: "sqlcipher"
104-
vcpkg: "sqlcipher"
101+
apt-get: libsqlcipher-dev
102+
brew: sqlcipher
103+
mingw: sqlcipher
104+
vcpkg: sqlcipher
105105
- run: bundle exec rake compile -- --with-sqlcipher
106106
- run: bundle exec rake test

test/test_sqlite3.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ def test_version_strings
2222
skip if SQLite3::VERSION.include?("test") # see set-version-to-timestamp rake task
2323
assert_equal(SQLite3::VERSION, SQLite3::VersionProxy::STRING)
2424
end
25+
26+
def test_compiled_version_and_loaded_version
27+
assert_equal(SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION)
28+
end
2529
end
2630
end

0 commit comments

Comments
 (0)