Skip to content

Commit

Permalink
Use Spring to save on subsequent boot times
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dacook committed May 21, 2024
1 parent f9014ef commit 84434c2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 84434c2

Please sign in to comment.