Skip to content

Commit faed80f

Browse files
committed
ci: more thorough user journey, integrated with rails main
1 parent 9539fe5 commit faed80f

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

.github/workflows/ci.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -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/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)