Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Caching tailwind build assets in CI #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
searls opened this issue Apr 28, 2025 · 0 comments
Closed

Caching tailwind build assets in CI #539

searls opened this issue Apr 28, 2025 · 0 comments

Comments

@searls
Copy link
Contributor

searls commented Apr 28, 2025

I'm here with a simple question: "is it possible to cache the tailwind build in CI?" My brand new app's Tailwind 4 build is quite slow in GitHub Actions and I would like to find a way to avoid paying the piper on every build (actually, twice on every build).

I was just scrutinizing my build time in GitHub Actions and came across this:

$ bin/rails db:test:prepare test test:system
≈ tailwindcss v4.1.4

Done in 9s
Running 47 tests in a single process (parallelization threshold is 50)
Run options: --seed 32133

# Running:

...............................................

Finished in 6.400974s, 7.3426 runs/s, 36.0883 assertions/s.
47 runs, 231 assertions, 0 failures, 0 errors, 0 skips
≈ tailwindcss v4.1.4

Done in 8s
Running 1 tests in a single process (parallelization threshold is 50)
Run options: --seed 604
# Running:
Capybara starting Puma...
* Version 6.6.0, codename: Return to Forever
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:39819/
.
Finished in 2.022590s, 0.4944 runs/s, 0.4944 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

Because both rails test and rails test:system each precompile assets (something I feel like is a bug when the same process is invoking them), I'm getting hit with a particularly expensive compilation step of 9s and then another of 8s. So that's 17 seconds for a test suite that doesn't depend on styles. It stood out to me because locally each build takes on the order of 380ms.

I was thinking that build results might be cached someplace like tmp/cache, but it appears they aren't cached anywhere in development or test? @flavorjones could you shed any light on what my options might be?

@rails rails locked and limited conversation to collaborators May 2, 2025
@flavorjones flavorjones converted this issue into discussion #543 May 2, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@searls and others