Skip to content

Commit 56027ad

Browse files
authored
Merge pull request rails#296 from rails/flavorjones-upstream-rails-testing
ci: more thorough user journey, integrated with rails main
2 parents 9539fe5 + 5933a40 commit 56027ad

File tree

4 files changed

+50
-23
lines changed

4 files changed

+50
-23
lines changed

.github/workflows/ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
ruby: ["2.7", "3.0", "3.1", "3.2"]
22+
ruby: ["2.7", "3.0", "3.1", "3.2", "head"]
2323
steps:
2424
- uses: actions/checkout@v3
2525
- run: rm Gemfile.lock
@@ -40,11 +40,9 @@ jobs:
4040
runs-on: ${{matrix.plat}}-latest
4141
steps:
4242
- uses: actions/checkout@v3
43-
- run: rm Gemfile.lock
4443
- uses: ruby/setup-ruby@v1
4544
with:
46-
ruby-version: "3.1"
47-
bundler-cache: true
45+
ruby-version: "3.2"
4846
bundler: latest
4947
- run: test/integration/user_journey_test.sh
5048
shell: bash

.github/workflows/gem-install.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- run: rm Gemfile.lock
2727
- uses: ruby/setup-ruby@v1
2828
with:
29-
ruby-version: "3.1"
29+
ruby-version: "3.2"
3030
bundler: latest
3131
bundler-cache: true
3232
- run: "bundle exec rake gem:${{matrix.platform}}"
@@ -42,7 +42,7 @@ jobs:
4242
steps:
4343
- uses: ruby/setup-ruby@v1
4444
with:
45-
ruby-version: "3.1"
45+
ruby-version: "3.2"
4646
- uses: actions/download-artifact@v3
4747
with:
4848
name: gem-ruby
@@ -56,7 +56,7 @@ jobs:
5656
steps:
5757
- uses: ruby/setup-ruby@v1
5858
with:
59-
ruby-version: "3.1"
59+
ruby-version: "3.2"
6060
- uses: actions/download-artifact@v3
6161
with:
6262
name: gem-x86_64-linux
@@ -68,12 +68,13 @@ jobs:
6868
needs: ["package"]
6969
runs-on: ubuntu-latest
7070
container:
71-
image: ruby:3.1-alpine
71+
image: ruby:3.2-alpine
7272
steps:
7373
- uses: actions/download-artifact@v3
7474
with:
7575
name: gem-x86_64-linux
7676
path: pkg
77+
- run: "apk add build-base" # to compile racc, etc.
7778
- run: "gem update --system" # let's make sure the latest is working for us (upstream test, see #200)
7879
- run: "gem install pkg/tailwindcss-rails-*.gem"
7980
- run: "tailwindcss --help"
@@ -88,7 +89,7 @@ jobs:
8889
path: pkg
8990
- run: |
9091
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
91-
docker run --rm -v "$(pwd):/test" -w /test --platform=linux/arm/v7 ruby:3.1 \
92+
docker run --rm -v "$(pwd):/test" -w /test --platform=linux/arm/v7 ruby:3.2 \
9293
/bin/bash -c "
9394
set -ex
9495
gem install pkg/tailwindcss-rails-*.gem
@@ -101,7 +102,7 @@ jobs:
101102
steps:
102103
- uses: ruby/setup-ruby@v1
103104
with:
104-
ruby-version: "3.1"
105+
ruby-version: "3.2"
105106
- uses: actions/download-artifact@v3
106107
with:
107108
name: gem-x86_64-darwin
@@ -129,7 +130,7 @@ jobs:
129130
steps:
130131
- uses: ruby/setup-ruby@v1
131132
with:
132-
ruby-version: "3.1"
133+
ruby-version: "3.2"
133134
- uses: actions/download-artifact@v3
134135
with:
135136
name: gem-x64-mingw-ucrt

.github/workflows/upstream.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@ on:
1414
- .github/workflows/upstream.yml # this file
1515

1616
jobs:
17-
rails:
18-
name: empty job
19-
runs-on: ubuntu-latest
17+
user-journey:
18+
name: "user-journey (rails main)"
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
plat: ["ubuntu", "windows", "macos"]
23+
runs-on: ${{matrix.plat}}-latest
24+
env:
25+
RAILSOPTS: --git=https://github.com/rails/rails --branch main
2026
steps:
21-
- run: echo hello world
27+
- uses: actions/checkout@v3
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: "3.2"
31+
bundler: latest
32+
- run: test/integration/user_journey_test.sh
33+
shell: bash

test/integration/user_journey_test.sh

+24-8
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,45 @@
55
set -o pipefail
66
set -eux
77

8+
# set up dependencies
9+
rm -f Gemfile.lock
10+
bundle remove actionmailer
11+
bundle add rails --skip-install ${RAILSOPTS:-}
12+
bundle install
13+
814
# fetch the upstream executables
915
bundle exec rake download
1016

11-
# create a rails app in a directory with spaces in the name (#176, #184)
12-
rm -rf "Has A Space"
13-
mkdir "Has A Space"
14-
pushd "Has A Space"
17+
# do our work a directory with spaces in the name (#176, #184)
18+
rm -rf "My Workspace"
19+
mkdir "My Workspace"
20+
pushd "My Workspace"
1521

16-
gem install rails
17-
rails new test-app --skip-bundle
22+
# create a rails app
23+
bundle exec rails -v
24+
bundle exec rails new test-app --skip-bundle
1825
pushd test-app
1926

20-
# install tailwindcss-rails
27+
# make sure to use the same version of rails (e.g., install from git source if necessary)
28+
bundle remove rails
29+
bundle add rails --skip-install ${RAILSOPTS:-}
30+
31+
# use the tailwindcss-rails under test
2132
bundle add tailwindcss-rails --path="../.."
2233
bundle install
34+
bundle show --paths
2335

36+
# install tailwindcss
2437
bin/rails tailwindcss:install
2538

39+
# TEST: tailwind was installed correctly
40+
grep tailwind app/views/layouts/application.html.erb
41+
42+
# TEST: rake tasks don't exec (#188)
2643
cat <<EOF >> Rakefile
2744
task :still_here do
2845
puts "Rake process did not exit early"
2946
end
3047
EOF
3148

32-
# ensure rake tasks don't exec (#188)
3349
bin/rails tailwindcss:build still_here | grep "Rake process did not exit early"

0 commit comments

Comments
 (0)