mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use Spring to save on subsequent boot times
Each time we run a rails command, it can take some time to load up (I think it was 20s). We run two commands (db setup, then rspec), so the second one should be faster now.
This commit is contained in:
26
.github/workflows/build.yml
vendored
26
.github/workflows/build.yml
vendored
@@ -65,7 +65,7 @@ jobs:
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create db:schema:load
|
||||
bin/rake db:create db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
@@ -83,7 +83,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)
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
bin/rake knapsack_pro:rspec
|
||||
|
||||
models:
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -125,7 +125,7 @@ jobs:
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create db:schema:load
|
||||
bin/rake db:create db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
@@ -142,7 +142,7 @@ jobs:
|
||||
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/models/**/*_spec.rb}"
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
bin/rake knapsack_pro:rspec
|
||||
|
||||
system_admin:
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -191,7 +191,7 @@ jobs:
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create db:schema:load
|
||||
bin/rake db:create db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
@@ -210,7 +210,7 @@ jobs:
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/admin/**/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:queue:rspec
|
||||
bin/rake knapsack_pro:queue:rspec
|
||||
|
||||
- name: Archive failed tests screenshots
|
||||
if: failure()
|
||||
@@ -268,7 +268,7 @@ jobs:
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create db:schema:load
|
||||
bin/rake db:create db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
@@ -287,7 +287,7 @@ jobs:
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/consumer/**/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:queue:rspec
|
||||
bin/rake knapsack_pro:queue:rspec
|
||||
|
||||
- name: Archive failed tests screenshots
|
||||
if: failure()
|
||||
@@ -346,7 +346,7 @@ jobs:
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create db:schema:load
|
||||
bin/rake db:create db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
@@ -365,7 +365,7 @@ jobs:
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/serializers/**/*_spec.rb,engines/**/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
bin/rake knapsack_pro:rspec
|
||||
|
||||
- name: Archive failed tests screenshots
|
||||
if: failure()
|
||||
@@ -424,7 +424,7 @@ jobs:
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create db:schema:load
|
||||
bin/rake db:create db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
@@ -441,7 +441,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: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
bin/rake knapsack_pro:rspec
|
||||
|
||||
non_knapsack_jest_karma:
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -475,7 +475,7 @@ jobs:
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Run JS tests
|
||||
run: bundle exec rake karma:run
|
||||
run: bin/rake karma:run
|
||||
|
||||
- name: Run jest tests
|
||||
run: yarn jest
|
||||
|
||||
Reference in New Issue
Block a user