Merge pull request #12418 from dacook/optimise-ci

Optimise CI
This commit is contained in:
Gaetan Craig-Riou
2024-05-06 11:05:28 +10:00
committed by GitHub

View File

@@ -55,6 +55,7 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# JS is required in order for webpacker to compile, in order to render templates containing image urls
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
@@ -64,8 +65,7 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:create db:schema:load
- name: Run tests
env:
@@ -123,20 +123,11 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:create db:schema:load
- name: Run tests
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
@@ -150,7 +141,6 @@ jobs:
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/models/**/*_spec.rb}"
run: |
bundle exec rake knapsack_pro:rspec
@@ -201,8 +191,7 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:create db:schema:load
- name: Run tests
@@ -279,8 +268,7 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:create db:schema:load
- name: Run tests
@@ -348,6 +336,7 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# JS is required in order for webpacker to compile, in order to render templates linking to mail.css
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
@@ -357,8 +346,7 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:create db:schema:load
- name: Run tests
@@ -426,6 +414,7 @@ jobs:
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# JS is required in order for webpacker to compile, in order to render templates linking to mail.css
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
@@ -435,11 +424,9 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:create db:schema:load
- name: Run tests
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: e3b8800198d2d89b70c7edbdd85f8fd8
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
@@ -453,8 +440,6 @@ jobs:
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#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
@@ -476,11 +461,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
# Rails is required for the Karma rake script
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
@@ -493,10 +474,6 @@ jobs:
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run JS tests
run: bundle exec rake karma:run