Skip to content

Commit

Permalink
Merge pull request #13096 from mkllnk/assets
Browse files Browse the repository at this point in the history
Compile assets on demand in test local environment
  • Loading branch information
rioug authored Jan 27, 2025
2 parents 6fb86dd + 95625c1 commit fa4785b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 33 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ jobs:

- name: Set up database
run: |
bin/rake db:create db:schema:load
bin/rails db:create db:schema:load
bin/rails runner spec/support/seeds.rb # Asset compile needs a country.
- name: Run tests
env:
Expand All @@ -84,7 +85,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/controllers/**/*_spec.rb}"
run: |
git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3)
bin/rake knapsack_pro:rspec
bin/rails assets:precompile knapsack_pro:rspec
- name: Save SimpleCov file
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -135,7 +136,7 @@ jobs:

- name: Set up database
run: |
bin/rake db:create db:schema:load
bin/rails db:create db:schema:load
- name: Run tests
env:
Expand Down Expand Up @@ -211,7 +212,8 @@ jobs:

- name: Set up database
run: |
bin/rake db:create db:schema:load
bin/rails db:create db:schema:load
bin/rails runner spec/support/seeds.rb # Asset compile needs a country.
- name: Run tests

Expand All @@ -230,7 +232,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/admin/**/*_spec.rb}"

run: |
bin/rake knapsack_pro:queue:rspec
bin/rails assets:precompile knapsack_pro:queue:rspec
- name: Save SimpleCov file
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -298,7 +300,8 @@ jobs:

- name: Set up database
run: |
bin/rake db:create db:schema:load
bin/rails db:create db:schema:load
bin/rails runner spec/support/seeds.rb # Asset compile needs a country.
- name: Run tests

Expand All @@ -317,7 +320,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/consumer/**/*_spec.rb}"

run: |
bin/rake knapsack_pro:queue:rspec
bin/rails assets:precompile knapsack_pro:queue:rspec
- name: Save SimpleCov file
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -386,7 +389,8 @@ jobs:

- name: Set up database
run: |
bin/rake db:create db:schema:load
bin/rails db:create db:schema:load
bin/rails runner spec/support/seeds.rb # Asset compile needs a country.
- name: Run tests

Expand All @@ -405,7 +409,7 @@ jobs:
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/serializers/**/*_spec.rb,engines/**/*_spec.rb}"

run: |
bin/rake knapsack_pro:rspec
bin/rails assets:precompile knapsack_pro:rspec
- name: Save SimpleCov file
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -465,7 +469,8 @@ jobs:

- name: Set up database
run: |
bin/rake db:create db:schema:load
bin/rails db:create db:schema:load
bin/rails runner spec/support/seeds.rb # Asset compile needs a country.
- name: Run tests
env:
Expand All @@ -482,7 +487,7 @@ jobs:
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN: "{engines/**/*_spec.rb,spec/models/**/*_spec.rb,spec/controllers/**/*_spec.rb,spec/serializers/**/*_spec.rb,spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/system/**/*_spec.rb}"
run: |
bin/rake knapsack_pro:rspec
bin/rails assets:precompile knapsack_pro:rspec
- name: Save SimpleCov file
uses: actions/upload-artifact@v4
Expand Down
5 changes: 1 addition & 4 deletions config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,4 @@ production: &production
cache_manifest: true

test:
<<: *production

# Compile test packs to a separate directory
public_output_path: packs-test
<<: *default
18 changes: 0 additions & 18 deletions spec/support/precompile_assets.rb

This file was deleted.

0 comments on commit fa4785b

Please sign in to comment.