Skip to content

Commit e9b1b6b

Browse files
committed
ci: more thorough user journey, integrated with rails main
1 parent 8f33c4f commit e9b1b6b

File tree

3 files changed

+58
-11
lines changed

3 files changed

+58
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: upstream
2+
concurrency:
3+
group: "${{github.workflow}}-${{github.ref}}"
4+
cancel-in-progress: true
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 8 * * 3" # At 08:00 on Wednesday # https://crontab.guru/#0_8_*_*_3
9+
pull_request:
10+
types: [opened, synchronize]
11+
branches:
12+
- '*'
13+
paths:
14+
- .github/workflows/upstream.yml # this file
15+
16+
jobs:
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
26+
steps:
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

Lines changed: 24 additions & 8 deletions
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)