Skip to content

Commit

Permalink
try to set matrix strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrieiz committed Aug 11, 2023
1 parent 316918a commit bda5aca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@ jobs:
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
# Set N number of parallel jobs you want to run tests on.
# Use higher number if you have slow tests to split them on more parallel jobs.
# Remember to update ci_node_index below to 0..N-1
ci_node_total: [4]
# set N-1 indexes for parallel jobs
# When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc
ci_node_index: [0, 1, 2, 3]

env:
RAILS_ENV: test
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL || 1 }}
CI_NODE_INDEX: ${{ secrets.CI_NODE_INDEX || 0 }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -52,6 +61,10 @@ jobs:
run: |
bundle exec rake code:analysis
- name: Run Tests
env:
KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: info
run: |
bundle exec rake knapsack:rspec
- name: Check for missing annotations
Expand Down
2 changes: 1 addition & 1 deletion knapsack_rspec_report.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"spec/models/user_spec.rb": 0.09392800001660362,
"spec/mailers/application_mailer_spec.rb": 0.0020680000307038426,
"spec/requests/api/v1/users/show_spec.rb": 0.5047900000354275
}
}

0 comments on commit bda5aca

Please sign in to comment.