diff --git a/.circleci/config.yml b/.circleci/config.yml index 9b22229bceab..d67aa07dd9e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,5 @@ version: 2 -common_env: &common_env - # CircleCI container has two cores, but Ruby can see 32 cores. So we - # configure test-queue. - # See https://github.com/tmm1/test-queue#environment-variables - TEST_QUEUE_WORKERS: 2 - spec_steps: &spec_steps - checkout - attach_workspace: @@ -14,8 +8,7 @@ spec_steps: &spec_steps - run: name: Run specs command: | - ./tmp/cc-test-reporter before-build - COVERAGE=true bundle exec rake spec + bundle exec rake spec ./tmp/cc-test-reporter format-coverage --output tmp/codeclimate.$CIRCLE_JOB.json - persist_to_workspace: root: tmp @@ -23,67 +16,11 @@ spec_steps: &spec_steps - codeclimate.*.json jobs: - # Ruby 2.7 - ruby-2.7-spec: - docker: - - image: cimg/ruby:2.7 - environment: - <<: *common_env - steps: - *spec_steps - - # Ruby 3.0 - ruby-3.0-spec: - docker: - - image: cimg/ruby:3.0 - environment: - <<: *common_env - steps: - *spec_steps - - # Ruby 3.1 - ruby-3.1-spec: - docker: - - image: cimg/ruby:3.1 - environment: - <<: *common_env - steps: - *spec_steps - - # Ruby 3.2 - ruby-3.2-spec: - docker: - - image: cimg/ruby:3.2 - environment: - <<: *common_env - steps: - *spec_steps - - # Ruby 3.3 - ruby-3.3-spec: - docker: - - image: cimg/ruby:3.3 - environment: - <<: *common_env - steps: - *spec_steps - - # ruby-head (nightly snapshot build) - ruby-head-spec: - docker: - - image: rubocophq/circleci-ruby-snapshot:latest - environment: - <<: *common_env - steps: - *spec_steps - # Job for downloading the Code Climate test reporter cc-setup: docker: # Specify the latest version to prevent "cimg/ruby:latest not found: manifest unknown: manifest unknown" error. - image: cimg/ruby:3.3 - environment: - <<: *common_env steps: - run: name: Download Code Climate test-reporter @@ -103,8 +40,6 @@ jobs: - image: cimg/ruby:3.3 environment: CC_TEST_REPORTER_ID: a11b66bfbb1acdf220d5cb317b2e945a986fd85adebe29a76d411ad6d74ec31f - environment: - <<: *common_env steps: - attach_workspace: at: ~/project/tmp diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f3f2f11d877e..b28cd1a6117c 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Yamllint - uses: karancode/yamllint-github-action@v2.1.1 - with: - yamllint_strict: true - yamllint_format: parsable - yamllint_comment: true - env: - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Yamllint + # uses: karancode/yamllint-github-action@v2.1.1 + # with: + # yamllint_strict: true + # yamllint_format: parsable + # yamllint_comment: true + # env: + # GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 278b33451520..c98d44542da9 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -15,9 +15,8 @@ concurrency: cancel-in-progress: true jobs: - main: - name: >- - ${{ matrix.os }} ${{ matrix.ruby }} + spec: + name: Spec - ${{ matrix.os }} ${{ matrix.ruby }} runs-on: ${{ matrix.os }}-latest env: # See https://github.com/tmm1/test-queue#environment-variables @@ -25,12 +24,8 @@ jobs: strategy: fail-fast: false matrix: - # [ubuntu, macos, windows] - os: [windows] + os: [ubuntu] ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head'] - include: - - os: windows - ruby: mingw exclude: - os: windows ruby: head @@ -38,143 +33,172 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - - name: set up Ruby + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true + - name: Set up Coverage + # Only collect coverage data on ubuntu runners + if: matrix.os == 'ubuntu' + run: echo "COVERAGE=true" >> $GITHUB_ENV - name: spec run: bundle exec rake spec - - ascii_spec: - name: Ascii Spec - ${{ matrix.os }} ${{ matrix.ruby }} - runs-on: ${{ matrix.os }}-latest - - strategy: - fail-fast: false - matrix: - os: [ubuntu, windows] - ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head'] - include: - - os: ubuntu - ruby: jruby-9.4 - - os: windows - ruby: mingw - exclude: - - os: windows - ruby: head + - name: Upload Coverage Artifact + if: matrix.os == 'ubuntu' + uses: actions/upload-artifact@v4 + with: + name: coverage-${{ matrix.os }}-${{ matrix.ruby }} + path: coverage/.resultset.json + if-no-files-found: error + + upload_coverage: + name: Upload Coverage + needs: spec + runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/download-artifact@v4 + name: Download Coverage Artifacts with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: ascii_spec - run: bundle exec rake ascii_spec + path: ${{github.workspace}}/coverage + pattern: coverage-* + - uses: paambaati/codeclimate-action@v6 + env: + CC_TEST_REPORTER_ID: 2653195ce32a1bec6714ba738f5e7061c7908e70ffa96e96e102ea2a8d8975b6 + with: + coverageLocations: ${{github.workspace}}/coverage/*:simplecov + debug: true - internal_investigation: - name: Internal Investigation - ${{ matrix.os }} ${{ matrix.ruby }} - runs-on: ${{ matrix.os }}-latest + # ascii_spec: + # name: Ascii Spec - ${{ matrix.os }} ${{ matrix.ruby }} + # runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false - matrix: - os: [ubuntu, windows] - ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head'] - include: - - os: ubuntu - ruby: jruby-9.4 - - os: windows - ruby: mingw - exclude: - - os: windows - ruby: head + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu, windows] + # ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head'] + # include: + # - os: ubuntu + # ruby: jruby-9.4 + # - os: windows + # ruby: mingw + # exclude: + # - os: windows + # ruby: head - steps: - - name: Windows Specific - if: matrix.os == 'windows' - run: | - # Work around `Layout/EndOfLine: Carriage return character detected` - git config --system core.autocrlf false - - name: checkout - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: internal_investigation - run: bundle exec rake internal_investigation - - name: Check requiring libraries successfully - # See https://github.com/rubocop/rubocop/pull/4523#issuecomment-309136113 - run: ruby -I lib -r bundler/setup -r rubocop -e 'exit 0' - - documentation_check: - name: Documentation Check - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3 - bundler-cache: true - - name: Check documentation syntax - run: bundle exec rake documentation_syntax_check + # 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: ascii_spec + # run: bundle exec rake ascii_spec - 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 + # internal_investigation: + # name: Internal Investigation - ${{ matrix.os }} ${{ matrix.ruby }} + # runs-on: ${{ matrix.os }}-latest - prism: - runs-on: ubuntu-latest - name: Prism - steps: - - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 - with: - # Specify the minimum Ruby version 2.7 required for Prism to run. - ruby-version: 2.7 - bundler-cache: true - - name: spec - env: - PARSER_ENGINE: parser_prism - run: bundle exec rake prism_spec + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu, windows] + # ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head'] + # include: + # - os: ubuntu + # ruby: jruby-9.4 + # - os: windows + # ruby: mingw + # exclude: + # - os: windows + # ruby: head - rspec4: - runs-on: ubuntu-latest - name: RSpec 4 - steps: - - uses: actions/checkout@v4 - - name: Use latest RSpec 4 from `4-0-dev` branch - run: | - sed -e "/'rspec', '~> 3/d" -i Gemfile - cat << EOF > Gemfile.local - gem 'rspec', github: 'rspec/rspec-metagem', branch: '4-0-dev' - gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev' - gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: '4-0-dev' - gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: '4-0-dev' - gem 'rspec-support', github: 'rspec/rspec-support', branch: '4-0-dev' - EOF - - name: set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - name: spec - run: bundle exec rake spec + # steps: + # - name: Windows Specific + # if: matrix.os == 'windows' + # run: | + # # Work around `Layout/EndOfLine: Carriage return character detected` + # git config --system core.autocrlf false + # - name: checkout + # uses: actions/checkout@v4 + # - name: set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: ${{ matrix.ruby }} + # bundler-cache: true + # - name: internal_investigation + # run: bundle exec rake internal_investigation + # - name: Check requiring libraries successfully + # # See https://github.com/rubocop/rubocop/pull/4523#issuecomment-309136113 + # run: ruby -I lib -r bundler/setup -r rubocop -e 'exit 0' + + # documentation_check: + # name: Documentation Check + # runs-on: ubuntu-latest + # steps: + # - name: checkout + # uses: actions/checkout@v4 + # - name: Set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: 3.3 + # bundler-cache: true + # - name: Check documentation syntax + # run: bundle exec rake documentation_syntax_check + + # 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 + + # prism: + # runs-on: ubuntu-latest + # name: Prism + # steps: + # - uses: actions/checkout@v4 + # - name: set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # # Specify the minimum Ruby version 2.7 required for Prism to run. + # ruby-version: 2.7 + # bundler-cache: true + # - name: spec + # env: + # PARSER_ENGINE: parser_prism + # run: bundle exec rake prism_spec + + # rspec4: + # runs-on: ubuntu-latest + # name: RSpec 4 + # steps: + # - uses: actions/checkout@v4 + # - name: Use latest RSpec 4 from `4-0-dev` branch + # run: | + # sed -e "/'rspec', '~> 3/d" -i Gemfile + # cat << EOF > Gemfile.local + # gem 'rspec', github: 'rspec/rspec-metagem', branch: '4-0-dev' + # gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev' + # gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: '4-0-dev' + # gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: '4-0-dev' + # gem 'rspec-support', github: 'rspec/rspec-support', branch: '4-0-dev' + # EOF + # - name: set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: 2.7 + # bundler-cache: true + # - name: spec + # run: bundle exec rake spec