Skip to content
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

Optimise CI #12418

Merged
merged 7 commits into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 10 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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

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

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

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

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

Expand All @@ -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:
Expand All @@ -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

Expand Down
Loading