Skip to content

Commit 739e899

Browse files
authored
Merge pull request #320 from sparklemotion/flavorjones-resurrect-native-gems
native gems, better system library support, more platform support
2 parents 8e21a44 + 95e16d3 commit 739e899

32 files changed

Lines changed: 6116 additions & 2299 deletions

.github/workflows/gem-install.yml

Lines changed: 327 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,327 @@
1+
name: native packaging
2+
concurrency:
3+
group: "${{github.workflow}}-${{github.ref}}"
4+
cancel-in-progress: true
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
- v*.*.x
11+
tags:
12+
- v*.*.*
13+
pull_request:
14+
types: [opened, synchronize]
15+
branches:
16+
- '*'
17+
18+
jobs:
19+
cache-tarball:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/cache@v3
24+
with:
25+
path: ports/archives
26+
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb')}}
27+
- uses: ruby/setup-ruby-pkgs@v1
28+
with:
29+
ruby-version: "3.1"
30+
bundler-cache: true
31+
- run: bundle exec ruby ./ext/sqlite3/extconf.rb --download-dependencies
32+
33+
cruby-package:
34+
needs: ["cache-tarball"]
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: actions/cache@v3
39+
with:
40+
path: ports/archives
41+
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb')}}
42+
- uses: ruby/setup-ruby-pkgs@v1
43+
with:
44+
ruby-version: "3.1"
45+
bundler-cache: true
46+
- run: ./bin/test-gem-build gems ruby
47+
- uses: actions/upload-artifact@v3
48+
with:
49+
name: cruby-gem
50+
path: gems
51+
retention-days: 1
52+
53+
cruby-linux-install:
54+
needs: ["cruby-package"]
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
sys: ["enable", "disable"]
59+
ruby: ["2.6", "2.7", "3.0", "3.1", "head"]
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v3
63+
- uses: MSP-Greg/setup-ruby-pkgs@v1
64+
with:
65+
ruby-version: "${{matrix.ruby}}"
66+
apt-get: "libsqlite3-dev pkg-config"
67+
- uses: actions/download-artifact@v3
68+
with:
69+
name: cruby-gem
70+
path: gems
71+
- run: ./bin/test-gem-install gems --${{matrix.sys}}-system-libraries
72+
73+
cruby-osx-install:
74+
needs: ["cruby-package"]
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
sys: ["enable", "disable"]
79+
ruby: ["3.1"]
80+
runs-on: macos-latest
81+
steps:
82+
- uses: actions/checkout@v3
83+
- uses: ruby/setup-ruby-pkgs@v1
84+
with:
85+
ruby-version: "${{matrix.ruby}}"
86+
- uses: actions/download-artifact@v3
87+
with:
88+
name: cruby-gem
89+
path: gems
90+
- run: ./bin/test-gem-install gems --${{matrix.sys}}-system-libraries
91+
92+
cruby-windows-install:
93+
needs: ["cruby-package"]
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
sys: ["enable", "disable"]
98+
ruby: ["3.0"]
99+
runs-on: windows-latest
100+
steps:
101+
- uses: actions/checkout@v3
102+
- uses: MSP-Greg/setup-ruby-pkgs@v1
103+
with:
104+
ruby-version: "3.0"
105+
mingw: "sqlite3"
106+
- uses: actions/download-artifact@v3
107+
with:
108+
name: cruby-gem
109+
path: gems
110+
- run: |
111+
gem install --verbose --no-document gems/*.gem -- --${{matrix.sys}}-system-libraries
112+
gem list -d sqlite3
113+
ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
114+
115+
cruby-windows-install-ucrt:
116+
needs: ["cruby-package"]
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
sys: ["enable", "disable"]
121+
ruby: ["3.1"]
122+
runs-on: windows-2022
123+
steps:
124+
- uses: actions/checkout@v3
125+
- uses: MSP-Greg/setup-ruby-pkgs@v1
126+
with:
127+
ruby-version: "3.1"
128+
mingw: "sqlite3"
129+
- uses: actions/download-artifact@v3
130+
with:
131+
name: cruby-gem
132+
path: gems
133+
- run: |
134+
gem install --verbose --no-document gems/*.gem -- --${{matrix.sys}}-system-libraries
135+
gem list -d sqlite3
136+
ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
137+
138+
cruby-native-package:
139+
needs: ["cache-tarball"]
140+
strategy:
141+
fail-fast: false
142+
matrix:
143+
plat:
144+
- "aarch64-linux"
145+
- "arm-linux"
146+
# - "arm64-darwin" # omitted until github actions supports it
147+
- "x64-mingw-ucrt"
148+
- "x64-mingw32"
149+
- "x86-linux"
150+
- "x86_64-darwin"
151+
- "x86_64-linux"
152+
runs-on: ubuntu-latest
153+
steps:
154+
- uses: actions/checkout@v3
155+
- uses: actions/cache@v3
156+
with:
157+
path: ports/archives
158+
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb')}}
159+
- run: |
160+
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
161+
larskanis/rake-compiler-dock-mri-${{matrix.plat}}:1.2.1 \
162+
./bin/test-gem-build gems ${{matrix.plat}}
163+
- uses: actions/upload-artifact@v3
164+
with:
165+
name: "cruby-${{matrix.plat}}-gem"
166+
path: gems
167+
retention-days: 1
168+
169+
cruby-aarch64-linux-install:
170+
needs: ["cruby-native-package"]
171+
strategy:
172+
fail-fast: false
173+
matrix:
174+
ruby: ["2.6", "2.7", "3.0", "3.1"]
175+
runs-on: ubuntu-latest
176+
steps:
177+
- uses: actions/checkout@v3
178+
- uses: actions/download-artifact@v3
179+
with:
180+
name: cruby-aarch64-linux-gem
181+
path: gems
182+
- run: |
183+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
184+
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
185+
--platform=linux/arm64/v8 \
186+
ruby:${{matrix.ruby}} \
187+
./bin/test-gem-install ./gems
188+
189+
cruby-arm-linux-install:
190+
needs: ["cruby-native-package"]
191+
strategy:
192+
fail-fast: false
193+
matrix:
194+
ruby: ["2.6", "2.7", "3.0", "3.1"]
195+
runs-on: ubuntu-latest
196+
steps:
197+
- uses: actions/checkout@v3
198+
- uses: actions/download-artifact@v3
199+
with:
200+
name: cruby-arm-linux-gem
201+
path: gems
202+
- run: |
203+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
204+
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
205+
--platform=linux/arm/v7 \
206+
ruby:${{matrix.ruby}} \
207+
./bin/test-gem-install ./gems
208+
209+
## arm64-darwin installation testing is omitted until github actions supports it
210+
# cruby-arm64-darwin-install:
211+
# ...
212+
213+
cruby-x64-mingw-ucrt-install:
214+
needs: ["cruby-native-package"]
215+
strategy:
216+
fail-fast: false
217+
matrix:
218+
ruby: ["3.1"]
219+
runs-on: windows-2022
220+
steps:
221+
- uses: actions/checkout@v3
222+
- uses: MSP-Greg/setup-ruby-pkgs@v1
223+
with:
224+
ruby-version: "${{matrix.ruby}}"
225+
- uses: actions/download-artifact@v3
226+
with:
227+
name: cruby-x64-mingw-ucrt-gem
228+
path: gems
229+
- run: |
230+
gem install --verbose --no-document gems/*.gem
231+
gem list -d sqlite3
232+
ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
233+
234+
cruby-x64-mingw32-install:
235+
needs: ["cruby-native-package"]
236+
strategy:
237+
fail-fast: false
238+
matrix:
239+
ruby: ["2.6", "2.7", "3.0"]
240+
runs-on: windows-2019
241+
steps:
242+
- uses: actions/checkout@v3
243+
- uses: ruby/setup-ruby@v1
244+
with:
245+
ruby-version: "${{matrix.ruby}}"
246+
- uses: actions/download-artifact@v3
247+
with:
248+
name: cruby-x64-mingw32-gem
249+
path: gems
250+
- run: |
251+
gem install --verbose --no-document gems/*.gem
252+
gem list -d sqlite3
253+
ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
254+
255+
cruby-x86-linux-install:
256+
needs: ["cruby-native-package"]
257+
strategy:
258+
fail-fast: false
259+
matrix:
260+
ruby: ["2.6", "2.7", "3.0", "3.1"]
261+
runs-on: ubuntu-latest
262+
steps:
263+
- uses: actions/checkout@v3
264+
- uses: actions/download-artifact@v3
265+
with:
266+
name: cruby-x86-linux-gem
267+
path: gems
268+
- run: |
269+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
270+
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
271+
--platform=linux/386 \
272+
ruby:${{matrix.ruby}} \
273+
./bin/test-gem-install ./gems
274+
275+
cruby-x86_64-darwin-install:
276+
needs: ["cruby-native-package"]
277+
strategy:
278+
fail-fast: false
279+
matrix:
280+
ruby: ["2.6", "2.7", "3.0", "3.1"]
281+
runs-on: macos-latest
282+
steps:
283+
- uses: actions/checkout@v3
284+
- uses: ruby/setup-ruby@v1
285+
with:
286+
ruby-version: "${{matrix.ruby}}"
287+
- uses: actions/download-artifact@v3
288+
with:
289+
name: cruby-x86_64-darwin-gem
290+
path: gems
291+
- run: ./bin/test-gem-install gems
292+
293+
cruby-x86_64-linux-install:
294+
needs: ["cruby-native-package"]
295+
strategy:
296+
fail-fast: false
297+
matrix:
298+
ruby: ["2.6", "2.7", "3.0", "3.1"]
299+
runs-on: ubuntu-latest
300+
steps:
301+
- uses: actions/checkout@v3
302+
- uses: ruby/setup-ruby@v1
303+
with:
304+
ruby-version: "${{matrix.ruby}}"
305+
- uses: actions/download-artifact@v3
306+
with:
307+
name: cruby-x86_64-linux-gem
308+
path: gems
309+
- run: ./bin/test-gem-install gems
310+
311+
cruby-x86_64-linux-musl-install:
312+
needs: ["cruby-native-package"]
313+
strategy:
314+
fail-fast: false
315+
matrix:
316+
ruby: ["2.6", "2.7", "3.0", "3.1"]
317+
runs-on: ubuntu-latest
318+
container:
319+
image: ruby:${{matrix.ruby}}-alpine
320+
steps:
321+
- uses: actions/checkout@v3
322+
- uses: actions/download-artifact@v3
323+
with:
324+
name: cruby-x86_64-linux-gem
325+
path: gems
326+
- run: apk add bash build-base
327+
- run: ./bin/test-gem-install ./gems

0 commit comments

Comments
 (0)