Skip to content

Commit b903029

Browse files
committed
MUSL support
1 parent 880b63c commit b903029

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/build-gems.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Build Gems
22
on:
3+
pull_request:
34
push:
45
branches:
56
- main
@@ -13,7 +14,7 @@ jobs:
1314
matrix:
1415
# TODO(cretz): Enable x64-mingw-ucrt if we can figure out Windows issue, see
1516
# https://github.com/temporalio/sdk-ruby/issues/172
16-
rubyPlatform: ["aarch64-linux", "x86_64-linux", "arm64-darwin", "x86_64-darwin"]
17+
rubyPlatform: ["aarch64-linux", "aarch64-linux-musl", "x86_64-linux", "x86_64-linux-musl", "arm64-darwin", "x86_64-darwin"]
1718
steps:
1819
- name: Checkout repository
1920
uses: actions/checkout@v4
@@ -86,6 +87,10 @@ jobs:
8687
# https://github.com/temporalio/sdk-ruby/issues/172
8788
os: [ubuntu-latest, macos-intel, macos-latest]
8889
rubyVersion: ["3.2", "3.3", "3.4"]
90+
# Container defaults to empty/none, but additional container for Alpine
91+
# added later
92+
container: [""]
93+
8994
include:
9095
- os: ubuntu-latest
9196
rubyPlatform: x86_64-linux
@@ -94,7 +99,12 @@ jobs:
9499
rubyPlatform: x86_64-darwin
95100
- os: macos-latest
96101
rubyPlatform: arm64-darwin
102+
- os: ubuntu-latest
103+
rubyVersion: "3.3"
104+
container: alpine/git:latest
105+
rubyPlatform: x86_64-linux-musl
97106
runs-on: ${{ matrix.runsOn || matrix.os }}
107+
container: ${{ matrix.container }}
98108
steps:
99109
- name: Checkout repository
100110
uses: actions/checkout@v4
@@ -107,12 +117,19 @@ jobs:
107117
name: ${{ matrix.rubyPlatform }}-gem
108118
path: local-gem
109119

120+
# This only works on official runners
110121
- name: Setup Ruby
122+
if: ${{ matrix.container == '' }}
111123
uses: oxidize-rb/actions/setup-ruby-and-rust@v1
112124
with:
113125
ruby-version: "${{ matrix.rubyVersion }}"
114126
bundler-cache: true
115127
cargo-cache: false
116128

129+
# Works for Alpine
130+
- name: Setup Ruby (Alpine)
131+
if: ${{ matrix.container == 'alpine/git:latest' }}
132+
run: apk add --no-cache ruby ruby-dev ruby-bundler build-base
133+
117134
- name: Run smoke test
118135
run: ruby ./temporalio/smoke_test/smoke_test_gem.rb 'local-gem/*-${{ matrix.rubyPlatform }}.gem'

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
# TODO(cretz): Enable ubuntu-24.04-arm when oxidize-rb/actions/setup-ruby-and-rust
15-
# supports it
14+
# TODO(cretz): Enable ubuntu-24.04-arm when setup-ruby-and-rust supports it, see
15+
# https://github.com/oxidize-rb/actions/issues/53
1616
#
1717
# TODO(cretz): Enable x64-mingw-ucrt if we can figure out Windows issue, see
1818
# https://github.com/temporalio/sdk-ruby/issues/172

temporalio/smoke_test/smoke_test_gem.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
gem_files = Dir.glob(ARGV.first)
66
raise "Unable to find single gem file, found #{gem_files.length}" unless gem_files.length == 1
77

8+
# TODO(cretz): For Linux musl, we have to install google-protobuf manually because latest versions do not work with
9+
# musl. Remove this when https://github.com/protocolbuffers/protobuf/issues/16853 is resolved.
10+
if RUBY_PLATFORM.include?('linux-musl')
11+
system('gem', 'install', '--verbose', 'google-protobuf', '--platform', 'ruby', exception: true)
12+
end
13+
814
system('gem', 'install', '--verbose', gem_files.first, exception: true)
915

1016
# Create a local environment and start a workflow

0 commit comments

Comments
 (0)