Skip to content

Commit

Permalink
Merge pull request #916 from fosterful/implement-selective
Browse files Browse the repository at this point in the history
Implement selective
  • Loading branch information
benjaminwood authored Nov 3, 2023
2 parents ccbd021 + 204f603 commit 31d1b19
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 10 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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ group :development, :test do
gem 'vcr'
gem 'spring'
gem 'spring-watcher-listen'
gem 'selective-ruby-rspec'
end

group :development do
Expand Down
14 changes: 9 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.15.0)
msgpack (1.4.4)
multipart-post (2.1.1)
Expand All @@ -238,8 +237,7 @@ GEM
mutant (= 0.11.4)
rspec-core (>= 3.8.0, < 4.0.0)
nio4r (2.5.8)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.19.1)
Expand Down Expand Up @@ -371,6 +369,11 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
selective-ruby-core (0.1.1-x86_64-linux)
zeitwerk (~> 2.6.12)
selective-ruby-rspec (0.1.0)
selective-ruby-core
zeitwerk (~> 2.6.12)
selectize-rails (0.12.6)
selenium-webdriver (4.8.1)
rexml (~> 3.2, >= 3.2.5)
Expand Down Expand Up @@ -447,10 +450,10 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.5.4)
zeitwerk (2.6.12)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
activeadmin
Expand Down Expand Up @@ -493,6 +496,7 @@ DEPENDENCIES
rspec-rails (>= 4.0.0.beta3)
rspec_junit_formatter
sassc-rails
selective-ruby-rspec
selectize-rails
selenium-webdriver
shoulda-matchers
Expand Down

0 comments on commit 31d1b19

Please sign in to comment.