Skip to content

Commit a3f6e46

Browse files
committed
test: add CI coverage for a standard user journey
primarily this is to exercise the rake tasks.
1 parent 17f61d2 commit a3f6e46

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/ci.yml

+16
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,19 @@ jobs:
3333

3434
- name: Run tests
3535
run: bin/test
36+
37+
user-journey:
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
plat: ["ubuntu", "windows", "macos"]
42+
runs-on: ${{matrix.plat}}-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: ruby/setup-ruby@v1
46+
with:
47+
ruby-version: "3.1"
48+
bundler-cache: true
49+
bundler: latest
50+
- run: test/integration/user_journey_test.sh
51+
shell: bash

test/integration/user_journey_test.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /usr/bin/env bash
2+
# reproduce the documented user journey for installing and running tailwindcss-rails
3+
# this is run in the CI pipeline, non-zero exit code indicates a failure
4+
5+
set -o pipefail
6+
set -eux
7+
8+
# fetch the upstream executables
9+
bundle exec rake download
10+
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"
15+
16+
gem install rails
17+
rails new test-app --skip-bundle
18+
pushd test-app
19+
20+
# install tailwindcss-rails
21+
echo 'gem "tailwindcss-rails", path: "../.."' >> Gemfile
22+
bundle install
23+
24+
bin/rails tailwindcss:install
25+
26+
# ensure rake tasks don't exec (#188)
27+
bin/rails tailwindcss:build about | grep "About your application"

0 commit comments

Comments
 (0)