Skip to content

Commit ee2db79

Browse files
committed
feat: add x86-linux-musl
ci: extract testing matrices for x86-linux gnu and musl
1 parent da4268d commit ee2db79

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
static: true
5858
- platform: x86-linux-gnu
5959
alias: x86-linux
60+
- platform: x86-linux-musl
6061
- platform: x86-mingw32
6162
- platform: x86_64-darwin
6263
- platform: x86_64-linux-gnu
@@ -254,6 +255,68 @@ jobs:
254255
ruby -rrcd_test -S rake test
255256
"
256257
258+
test_x86-linux-gnu:
259+
name: x86-linux-gnu
260+
needs: build_native_gem
261+
strategy:
262+
fail-fast: false
263+
matrix:
264+
ruby: ["3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
265+
platform: [x86-linux]
266+
include:
267+
# ruby 3.0 and earlier ship rubygems < 3.2.33, so can't recognize the -gnu suffix
268+
- ruby: "3.3"
269+
platform: x86-linux-gnu
270+
- ruby: "3.2"
271+
platform: x86-linux-gnu
272+
- ruby: "3.1"
273+
platform: x86-linux-gnu
274+
runs-on: ubuntu-latest
275+
steps:
276+
- uses: actions/checkout@v3
277+
- name: Download gem-${{ matrix.platform }}
278+
uses: actions/download-artifact@v3
279+
with:
280+
name: gem-${{ matrix.platform }}
281+
- name: Run tests
282+
run: |
283+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
284+
docker run --rm -v $PWD:/work -w /work \
285+
--platform=linux/386 ruby:${{ matrix.ruby }} \
286+
sh -c "
287+
gem install --local *.gem --verbose &&
288+
cd test/rcd_test/ &&
289+
bundle install &&
290+
ruby -rrcd_test -S rake test
291+
"
292+
293+
test_x86-linux-musl:
294+
name: x86-linux-musl
295+
needs: build_native_gem
296+
strategy:
297+
fail-fast: false
298+
matrix:
299+
ruby: ["3.3", "3.2", "3.1", "3.0", "2.7"] # ruby:2.6-alpine and earlier ship with rubygems that doesn't recognize the -musl suffix
300+
platform: [x86-linux-musl]
301+
runs-on: ubuntu-latest
302+
steps:
303+
- uses: actions/checkout@v3
304+
- name: Download gem-${{ matrix.platform }}
305+
uses: actions/download-artifact@v3
306+
with:
307+
name: gem-${{ matrix.platform }}
308+
- name: Run tests
309+
run: |
310+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
311+
docker run --rm -v $PWD:/work -w /work \
312+
--platform=linux/386 ruby:${{ matrix.ruby }}-alpine \
313+
sh -c "
314+
gem install --local *.gem --verbose &&
315+
cd test/rcd_test/ &&
316+
bundle install &&
317+
ruby -rrcd_test -S rake test
318+
"
319+
257320
test_native_gem:
258321
name: test native
259322
needs: build_native_gem

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/Dockerfile.mri.x64-mingw-ucrt
77
/Dockerfile.mri.x64-mingw32
88
/Dockerfile.mri.x86-linux-gnu
9+
/Dockerfile.mri.x86-linux-musl
910
/Dockerfile.mri.x86-mingw32
1011
/Dockerfile.mri.x86_64-darwin
1112
/Dockerfile.mri.x86_64-linux-gnu

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ platforms = [
1616
["x64-mingw-ucrt", "x86_64-w64-mingw32"],
1717
["x64-mingw32", "x86_64-w64-mingw32"],
1818
["x86-linux-gnu", "i686-redhat-linux-gnu"],
19+
["x86-linux-musl", "i686-unknown-linux-musl"],
1920
["x86-mingw32", "i686-w64-mingw32"],
2021
["x86_64-darwin", "x86_64-apple-darwin"],
2122
["x86_64-linux-gnu", "x86_64-redhat-linux-gnu"],

test/rcd_test/Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ else
2828
x64-mingw32
2929
x86-linux
3030
x86-linux-gnu
31+
x86-linux-musl
3132
x86-mingw32
3233
x86_64-darwin
3334
x86_64-linux

0 commit comments

Comments
 (0)