Skip to content

Commit

Permalink
Configure CI to use selective with four parallel runners
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Vick <[email protected]>
  • Loading branch information
benjaminwood and natevick committed Nov 3, 2023
1 parent 68f9ce6 commit 204f603
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ jobs:
--health-retries 5
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
ci_node_total: [4]
ci_node_index: [0, 1, 2, 3]

env:
SELECTIVE_API_KEY: ${{ secrets.SELECTIVE_API_KEY }}
SELECTIVE_RUN_ID: ${{ github.run_id }}
SELECTIVE_RUN_ATTEMPT: ${{ github.run_attempt }}
SELECTIVE_RUNNER_ID: ${{ matrix.ci_node_index }}
PR_TITLE: ${{ github.event.pull_request.title }}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -76,17 +88,42 @@ jobs:
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
bundle exec rspec --profile 10 \
--format progress \
bundle exec selective rspec --format progress \
--format RspecJunitFormatter \
--out junit/rspec.xml
--out junit/rspec-$SELECTIVE_RUNNER_ID.xml
./cc-test-reporter format-coverage -t simplecov
./cc-test-reporter upload-coverage
./cc-test-reporter format-coverage -t simplecov -o $GITHUB_WORKSPACE/coverage/codeclimate.$SELECTIVE_RUNNER_ID.json
- name: Upload coverage artifacts
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage

- name: Upload JUnit artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: junit
path: junit

upload-coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Download coverage artifacts
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage

- name: Prepare CodeClimate Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Upload coverage to CodeClimate
run: |
./cc-test-reporter sum-coverage coverage/codeclimate.*.json
./cc-test-reporter upload-coverage

0 comments on commit 204f603

Please sign in to comment.