Skip to content

Commit 5f6c4b3

Browse files
authored
Merge pull request #202 from rails/200-musl-issues-on-latest-bundler
ci: try to reproduce the musl issue from #200
2 parents 89e1b30 + 1dc1c5c commit 5f6c4b3

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

.github/workflows/ci.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
ruby: [2.7, "3.0", 3.1]
23-
22+
ruby: ["2.7", "3.0", "3.1"]
2423
steps:
2524
- uses: actions/checkout@v2
26-
27-
- name: Set up Ruby
28-
uses: ruby/setup-ruby@v1
25+
- run: rm Gemfile.lock
26+
- uses: ruby/setup-ruby@v1
2927
with:
30-
ruby-version: ${{ matrix.ruby }}
28+
ruby-version: ${{matrix.ruby}}
3129
bundler: latest
3230
bundler-cache: true
33-
3431
- name: Run tests
3532
run: bin/test
3633

@@ -42,6 +39,7 @@ jobs:
4239
runs-on: ${{matrix.plat}}-latest
4340
steps:
4441
- uses: actions/checkout@v2
42+
- run: rm Gemfile.lock
4543
- uses: ruby/setup-ruby@v1
4644
with:
4745
ruby-version: "3.1"

.github/workflows/gem-install.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v2
26+
- run: rm Gemfile.lock
2627
- uses: ruby/setup-ruby@v1
2728
with:
28-
ruby-version: "3.0"
29+
ruby-version: "3.1"
2930
bundler: latest
3031
bundler-cache: true
3132
- run: "bundle exec rake gem:${{matrix.platform}}"
@@ -41,7 +42,7 @@ jobs:
4142
steps:
4243
- uses: ruby/setup-ruby@v1
4344
with:
44-
ruby-version: "3.0"
45+
ruby-version: "3.1"
4546
- uses: actions/download-artifact@v2
4647
with:
4748
name: gem-ruby
@@ -55,11 +56,26 @@ jobs:
5556
steps:
5657
- uses: ruby/setup-ruby@v1
5758
with:
58-
ruby-version: "3.0"
59+
ruby-version: "3.1"
60+
- uses: actions/download-artifact@v2
61+
with:
62+
name: gem-x86_64-linux
63+
path: pkg
64+
- run: "gem install pkg/tailwindcss-rails-*.gem"
65+
- run: "tailwindcss --help"
66+
67+
linux-musl-install:
68+
needs: ["package"]
69+
runs-on: ubuntu-latest
70+
container:
71+
image: ruby:3.1-alpine
72+
steps:
5973
- uses: actions/download-artifact@v2
6074
with:
6175
name: gem-x86_64-linux
6276
path: pkg
77+
- run: "gem update --system"
78+
- run: "apk add build-base" # TODO: remove after https://github.com/rubygems/rubygems/issues/5914 is in a rubygems release
6379
- run: "gem install pkg/tailwindcss-rails-*.gem"
6480
- run: "tailwindcss --help"
6581

@@ -69,7 +85,7 @@ jobs:
6985
steps:
7086
- uses: ruby/setup-ruby@v1
7187
with:
72-
ruby-version: "3.0"
88+
ruby-version: "3.1"
7389
- uses: actions/download-artifact@v2
7490
with:
7591
name: gem-x86_64-darwin

lib/tailwindcss/commands.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ def platform
1818
def executable(
1919
exe_path: File.expand_path(File.join(__dir__, "..", "..", "exe"))
2020
)
21-
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(p) }
21+
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(Gem::Platform.new(p)) }
2222
raise UnsupportedPlatformException, <<~MESSAGE
2323
tailwindcss-rails does not support the #{platform} platform
2424
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
2525
MESSAGE
2626
end
2727

2828
exe_path = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f|
29-
Gem::Platform.match(File.basename(File.dirname(f)))
29+
Gem::Platform.match(Gem::Platform.new(File.basename(File.dirname(f))))
3030
end
3131

3232
if exe_path.nil?

0 commit comments

Comments
 (0)