Skip to content

Commit

Permalink
Merge pull request #398 from koic/migrate_to_gha_from_circleci
Browse files Browse the repository at this point in the history
Migrate to GitHub Actions from CircleCI
  • Loading branch information
koic committed Nov 29, 2023
2 parents 2ce33e5 + eef0431 commit efa8759
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 53 deletions.
52 changes: 0 additions & 52 deletions .circleci/config.yml

This file was deleted.

56 changes: 55 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -12,9 +12,63 @@ concurrency:
cancel-in-progress: true

jobs:
main:
name: Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
env:
# See https://github.com/tmm1/test-queue#environment-variables
TEST_QUEUE_WORKERS: 2
strategy:
fail-fast: false
matrix:
os: [ubuntu]
ruby: ['2.7', '3.0', '3.1', '3.2', 'head']

steps:
- name: checkout
uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: spec
run: bundle exec rake spec
- name: internal_investigation
run: bundle exec rake internal_investigation

jruby:
name: JRuby 9.4
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: jruby-9.4
bundler-cache: true
- name: spec
run: bundle exec rake spec
- name: internal_investigation
run: bundle exec rake internal_investigation

documentation_checks:
runs-on: ubuntu-latest
name: Check documentation syntax
steps:
- uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: test
run: bundle exec rake documentation_syntax_check

oldest_supported_rubocop:
runs-on: ubuntu-latest
name: The oldest supported RuboCop version
name: Check the oldest supported RuboCop version
steps:
- uses: actions/checkout@v4
- name: Use the oldest supported RuboCop
Expand Down
16 changes: 16 additions & 0 deletions spec/rubocop/cop/performance/sum_spec.rb
Expand Up @@ -249,6 +249,10 @@
^{method}^^^^^ Use `sum` instead of `#{method}(&:+)`, unless calling `#{method}(&:+)` on an empty array.
RUBY

# FIXME: The following failures in JRuby need to be fixed:
# https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215
skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby'

expect_correction(<<~RUBY)
array.sum
RUBY
Expand All @@ -260,6 +264,10 @@
^{method}^^^^ Use `sum` instead of `#{method}(:+)`, unless calling `#{method}(:+)` on an empty array.
RUBY

# FIXME: The following failures in JRuby need to be fixed:
# https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215
skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby'

expect_correction(<<~RUBY)
array.sum
RUBY
Expand All @@ -271,6 +279,10 @@
^{method}^^^ Use `sum` instead of `#{method}(:+)`, unless calling `#{method}(:+)` on an empty array.
RUBY

# FIXME: The following failures in JRuby need to be fixed:
# https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215
skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby'

expect_correction(<<~RUBY)
array.sum
RUBY
Expand All @@ -282,6 +294,10 @@
^{method}^^^^ Use `sum` instead of `#{method}(:+)`.
RUBY

# FIXME: The following failures in JRuby need to be fixed:
# https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215
skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby'

expect_correction(<<~RUBY)
[1, 2, 3].sum
RUBY
Expand Down

0 comments on commit efa8759

Please sign in to comment.