-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI workflow to upload results and call rake task
- Loading branch information
1 parent
5f9b14d
commit a816814
Showing
3 changed files
with
98 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Build | |
on: | ||
workflow_dispatch: | ||
push: | ||
branches-ignore: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
pull_request: | ||
|
||
|
@@ -47,7 +47,7 @@ jobs: | |
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
with: | ||
redis-version: 6 | ||
|
||
- name: Set up Ruby | ||
|
@@ -81,11 +81,19 @@ jobs: | |
# RSpec split test files by test examples feature - it's optional | ||
# 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/controllers/**/*_spec.rb}" | ||
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 | ||
- name: Save SimpleCov file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: __simplecov-chunk-controllers-${{ matrix.ci_node_index }} | ||
path: coverage/*.* | ||
retention-days: 2 # doesn't need to be long, because it's the combined results that matter | ||
if-no-files-found: ignore | ||
|
||
models: | ||
runs-on: ubuntu-22.04 | ||
services: | ||
|
@@ -116,7 +124,7 @@ jobs: | |
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
with: | ||
redis-version: 6 | ||
|
||
- name: Set up Ruby | ||
|
@@ -141,10 +149,18 @@ jobs: | |
# RSpec split test files by test examples feature - it's optional | ||
# 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}" | ||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/models/**/*_spec.rb}" | ||
run: | | ||
bin/rake knapsack_pro:rspec | ||
- name: Save SimpleCov file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: __simplecov-chunk-models-${{ matrix.ci_node_index }} | ||
path: coverage/*.* | ||
retention-days: 2 # doesn't need to be long, because it's the combined results that matter | ||
if-no-files-found: ignore | ||
|
||
system_admin: | ||
runs-on: ubuntu-22.04 | ||
services: | ||
|
@@ -175,7 +191,7 @@ jobs: | |
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
with: | ||
redis-version: 6 | ||
|
||
- name: Set up Ruby | ||
|
@@ -209,11 +225,19 @@ jobs: | |
# RSpec split test files by test examples feature - it's optional | ||
# 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/system/admin/**/*_spec.rb}" | ||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/admin/**/*_spec.rb}" | ||
|
||
run: | | ||
bin/rake knapsack_pro:queue:rspec | ||
- name: Save SimpleCov file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: __simplecov-chunk-system-admin-${{ matrix.ci_node_index }} | ||
path: coverage/*.* | ||
retention-days: 2 # doesn't need to be long, because it's the combined results that matter | ||
if-no-files-found: ignore | ||
|
||
- name: Archive failed tests screenshots | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -247,13 +271,13 @@ jobs: | |
ci_node_total: [12] | ||
# Indexes for parallel jobs (starting from zero). | ||
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. | ||
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | ||
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
with: | ||
redis-version: 6 | ||
|
||
- name: Set up Ruby | ||
|
@@ -287,11 +311,19 @@ jobs: | |
# RSpec split test files by test examples feature - it's optional | ||
# 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/system/consumer/**/*_spec.rb}" | ||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/consumer/**/*_spec.rb}" | ||
|
||
run: | | ||
bin/rake knapsack_pro:queue:rspec | ||
- name: Save SimpleCov file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: __simplecov-chunk-system-consumer-${{ matrix.ci_node_index }} | ||
path: coverage/*.* | ||
retention-days: 2 # doesn't need to be long, because it's the combined results that matter | ||
if-no-files-found: ignore | ||
|
||
- name: Archive failed tests screenshots | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -331,7 +363,7 @@ jobs: | |
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
with: | ||
redis-version: 6 | ||
|
||
- name: Set up Ruby | ||
|
@@ -371,6 +403,14 @@ jobs: | |
run: | | ||
bin/rake knapsack_pro:rspec | ||
- name: Save SimpleCov file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: __simplecov-chunk-engines-${{ matrix.ci_node_index }} | ||
path: coverage/*.* | ||
retention-days: 2 # doesn't need to be long, because it's the combined results that matter | ||
if-no-files-found: ignore | ||
|
||
test_the_rest: | ||
runs-on: ubuntu-22.04 | ||
services: | ||
|
@@ -401,7 +441,7 @@ jobs: | |
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
with: | ||
redis-version: 6 | ||
|
||
- name: Set up Ruby | ||
|
@@ -439,6 +479,14 @@ jobs: | |
run: | | ||
bin/rake knapsack_pro:rspec | ||
- name: Save SimpleCov file | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: __simplecov-chunk-the-rest-${{ matrix.ci_node_index }} | ||
path: coverage/*.* | ||
retention-days: 2 # doesn't need to be long, because it's the combined results that matter | ||
if-no-files-found: ignore | ||
|
||
non_knapsack_jest_karma: | ||
runs-on: ubuntu-22.04 | ||
services: | ||
|
@@ -476,3 +524,38 @@ jobs: | |
|
||
- name: Run jest tests | ||
run: yarn jest | ||
|
||
collate_simplecov_results: | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- controllers | ||
- models | ||
- engines | ||
- system_admin | ||
- system_consumer | ||
- test_the_rest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
|
||
- name: Download individual results from individual runners | ||
uses: actions/download-artifact@v3 | ||
with: | ||
pattern: __simplecov-chunk-* | ||
path: tmp/simplecov | ||
merge-multiple: true | ||
|
||
- name: collate results from each of the workers | ||
run: bundle exec rake 'simplecov:collate_results[tmp/simplecov]' | ||
|
||
- name: Upload collated results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: simplecov-combined-results | ||
path: coverage/*.* | ||
retention-days: 7 | ||
if-no-files-found: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters