1- name : native packaging
1+ name : sqlite3-ruby test suite
22concurrency :
33 group : " ${{github.workflow}}-${{github.ref}}"
44 cancel-in-progress : true
1818 - ' *'
1919
2020jobs :
21- setup :
21+ #
22+ # basic tests
23+ #
24+ sqlite3 :
25+ strategy :
26+ fail-fast : false
27+ matrix :
28+ os : [ubuntu-latest, macos-latest, windows-latest]
29+ ruby : ["3.3", "3.2", "3.1", "3.0"]
30+ lib : [system, packaged]
31+ include :
32+ - { os: ubuntu-latest, ruby: truffleruby, lib: packaged }
33+ - { os: windows-latest, ruby: ucrt, lib: system }
34+ - { os: windows-latest, ruby: mswin, lib: system }
35+
36+ runs-on : ${{matrix.os}}
37+ steps :
38+ - if : matrix.os == 'windows-latest'
39+ name : configure git crlf
40+ run : |
41+ git config --system core.autocrlf false
42+ git config --system core.eol lf
43+ - uses : actions/checkout@v4
44+ - uses : ruby/setup-ruby-pkgs@v1
45+ with :
46+ ruby-version : ${{matrix.ruby}}
47+ bundler-cache : true
48+ apt-get : libsqlite3-dev
49+ brew : sqlite3 pkg-config
50+ mingw : sqlite3
51+ vcpkg : sqlite3
52+ - if : matrix.lib == 'packaged'
53+ uses : actions/cache@v4
54+ with :
55+ path : ports
56+ key : ports-${{matrix.os}}-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}}
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+
67+ - run : bundle exec rake test
68+
69+ # reported at https://github.com/sparklemotion/sqlite3-ruby/issues/354
70+ # TODO remove once https://github.com/flavorjones/mini_portile/issues/118 is fixed
71+ fedora :
72+ runs-on : ubuntu-latest
73+ container :
74+ image : fedora:35
75+ steps :
76+ - run : |
77+ dnf group install -y "C Development Tools and Libraries"
78+ dnf install -y ruby ruby-devel libyaml-devel
79+ - uses : actions/checkout@v4
80+ - run : bundle install
81+ - run : bundle exec rake compile -- --disable-system-libraries
82+ - run : bundle exec rake test
83+
84+ sqlcipher :
85+ strategy :
86+ fail-fast : false
87+ matrix :
88+ os : [ubuntu-latest, macos-latest, windows-latest]
89+ ruby : ["3.3", "3.0"] # oldest and newest
90+ include :
91+ - { os: windows-latest, ruby: mingw }
92+ - { os: windows-latest, ruby: mswin }
93+ runs-on : ${{matrix.os}}
94+ steps :
95+ - if : matrix.os == 'windows-latest'
96+ name : configure git crlf
97+ run : |
98+ git config --system core.autocrlf false
99+ git config --system core.eol lf
100+ - uses : actions/checkout@v4
101+ - uses : ruby/setup-ruby-pkgs@v1
102+ with :
103+ ruby-version : ${{matrix.ruby}}
104+ bundler-cache : true
105+ apt-get : libsqlcipher-dev
106+ brew : sqlcipher pkg-config
107+ mingw : sqlcipher
108+ vcpkg : sqlcipher
109+ - run : bundle exec rake compile -- --with-sqlcipher
110+ - run : bundle exec rake test
111+
112+ valgrind :
113+ runs-on : ubuntu-latest
114+ steps :
115+ - uses : actions/checkout@v4
116+ - uses : ruby/setup-ruby-pkgs@v1
117+ with :
118+ ruby-version : " 3.3"
119+ bundler-cache : true
120+ apt-get : libsqlite3-dev valgrind
121+ - run : bundle install
122+ - run : bundle exec rake compile
123+ - run : bundle exec rake test:valgrind
124+
125+ rcd_setup :
126+ needs : ["sqlite3"]
22127 runs-on : ubuntu-latest
23128 outputs :
24129 rcd_image_version : ${{steps.rcd_image_version.outputs.rcd_image_version}}
37142 run : bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> $GITHUB_OUTPUT
38143
39144 cruby-package :
40- needs : ["setup "]
145+ needs : ["rcd_setup "]
41146 runs-on : ubuntu-latest
42147 steps :
43148 - uses : actions/checkout@v4
@@ -146,7 +251,7 @@ jobs:
146251 ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
147252
148253 cruby-native-package :
149- needs : ["setup "]
254+ needs : ["rcd_setup "]
150255 strategy :
151256 fail-fast : false
152257 matrix :
@@ -167,7 +272,7 @@ jobs:
167272 path : ports/archives
168273 key : ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}}
169274 - env :
170- DOCKER_IMAGE : " ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.setup .outputs.rcd_image_version}}-mri-${{matrix.plat}}"
275+ DOCKER_IMAGE : " ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_setup .outputs.rcd_image_version}}-mri-${{matrix.plat}}"
171276 run : |
172277 docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 ${DOCKER_IMAGE} \
173278 ./bin/test-gem-build gems ${{matrix.plat}}
0 commit comments