Skip to content

Commit 0ef0869

Browse files
committed
ci: let's test this badboy
1 parent 8f308f4 commit 0ef0869

File tree

2 files changed

+175
-15
lines changed

2 files changed

+175
-15
lines changed

.github/workflows/gem-install.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: 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+
tags:
11+
- v*.*.*
12+
pull_request:
13+
types: [opened, synchronize]
14+
branches:
15+
- '*'
16+
17+
jobs:
18+
package:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
platform: ["ruby", "x64-mingw32", "x64-mingw-ucrt", "x86_64-darwin", "arm64-darwin", "x86_64-linux", "arm-linux"]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- run: rm Gemfile.lock
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: "3.2"
30+
bundler: latest
31+
bundler-cache: true
32+
- run: "bundle exec rake gem:${{matrix.platform}}"
33+
- uses: actions/upload-artifact@v4
34+
with:
35+
name: gem-${{matrix.platform}}
36+
path: pkg
37+
retention-days: 1
38+
39+
vanilla-install:
40+
needs: ["package"]
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: ruby/setup-ruby@v1
44+
with:
45+
ruby-version: "3.2"
46+
- uses: actions/download-artifact@v4
47+
with:
48+
name: gem-ruby
49+
path: pkg
50+
- run: "gem install pkg/tailwindcss-rails-*.gem"
51+
- run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'"
52+
53+
linux-install:
54+
needs: ["package"]
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: ruby/setup-ruby@v1
58+
with:
59+
ruby-version: "3.2"
60+
- uses: actions/download-artifact@v4
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.2-alpine
72+
steps:
73+
- uses: actions/download-artifact@v4
74+
with:
75+
name: gem-x86_64-linux
76+
path: pkg
77+
- run: "apk add build-base" # to compile racc, etc.
78+
- run: "gem update --system" # let's make sure the latest is working for us (upstream test, see #200)
79+
- run: "gem install pkg/tailwindcss-rails-*.gem"
80+
- run: "tailwindcss --help"
81+
82+
linux-arm-install:
83+
needs: ["package"]
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/download-artifact@v4
87+
with:
88+
name: gem-arm-linux
89+
path: pkg
90+
- run: |
91+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
92+
docker run --rm -v "$(pwd):/test" -w /test --platform=linux/arm/v7 ruby:3.2 \
93+
/bin/bash -c "
94+
set -ex
95+
gem install pkg/tailwindcss-rails-*.gem
96+
tailwindcss --help
97+
"
98+
99+
darwin-x86_64-install:
100+
needs: ["package"]
101+
runs-on: macos-13
102+
steps:
103+
- uses: ruby/setup-ruby@v1
104+
with:
105+
ruby-version: "3.2"
106+
- uses: actions/download-artifact@v4
107+
with:
108+
name: gem-x86_64-darwin
109+
path: pkg
110+
- run: "gem install pkg/tailwindcss-rails-*.gem"
111+
- run: "tailwindcss --help"
112+
113+
darwin-arm64-install:
114+
needs: ["package"]
115+
runs-on: macos-14
116+
steps:
117+
- uses: ruby/setup-ruby@v1
118+
with:
119+
ruby-version: "3.2"
120+
- uses: actions/download-artifact@v4
121+
with:
122+
name: gem-arm64-darwin
123+
path: pkg
124+
- run: "gem install pkg/tailwindcss-rails-*.gem"
125+
- run: "tailwindcss --help"
126+
127+
windows-install:
128+
needs: ["package"]
129+
runs-on: windows-latest
130+
steps:
131+
- uses: ruby/setup-ruby@v1
132+
with:
133+
ruby-version: "3.0"
134+
- uses: actions/download-artifact@v4
135+
with:
136+
name: gem-x64-mingw32
137+
path: pkg
138+
- run: "gem install pkg/tailwindcss-rails-*.gem"
139+
- run: "tailwindcss --help"
140+
141+
windows-ucrt-install:
142+
needs: ["package"]
143+
runs-on: windows-2022
144+
steps:
145+
- uses: ruby/setup-ruby@v1
146+
with:
147+
ruby-version: "3.2"
148+
- uses: actions/download-artifact@v4
149+
with:
150+
name: gem-x64-mingw-ucrt
151+
path: pkg
152+
- run: "gem install pkg/tailwindcss-rails-*.gem"
153+
- run: "tailwindcss --help"

.github/workflows/main.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
1-
name: Ruby
2-
1+
name: ci
2+
concurrency:
3+
group: "${{github.workflow}}-${{github.ref}}"
4+
cancel-in-progress: true
35
on:
6+
workflow_dispatch:
47
push:
58
branches:
69
- main
7-
10+
tags:
11+
- v*.*.*
812
pull_request:
13+
types: [opened, synchronize]
14+
branches:
15+
- '*'
916

1017
jobs:
1118
build:
1219
runs-on: ubuntu-latest
13-
name: Ruby ${{ matrix.ruby }}
1420
strategy:
21+
fail-fast: false
1522
matrix:
16-
ruby:
17-
- '3.3.5'
18-
23+
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "head"]
1924
steps:
20-
- uses: actions/checkout@v4
21-
- name: Set up Ruby
22-
uses: ruby/setup-ruby@v1
23-
with:
24-
ruby-version: ${{ matrix.ruby }}
25-
bundler-cache: true
26-
- name: Run the default task
27-
run: bundle exec rake
25+
- uses: actions/checkout@v4
26+
- run: rm Gemfile.lock
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: ${{matrix.ruby}}
30+
rubygems: "3.4.22" # last version to support Ruby 2.7
31+
bundler: latest
32+
bundler-cache: true
33+
- name: Run tests
34+
run: bundle exec rake test

0 commit comments

Comments
 (0)