From 70cf59be2255943cf0f96f78891756a1e05e7a8c Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:22:07 +0100 Subject: [PATCH 1/7] Import RuboCop spellcheck workflow It uses a dedicated action which makes it easier to grep --- .github/workflows/spell_checking.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/spell_checking.yml b/.github/workflows/spell_checking.yml index b938ca3c3..19b4eb7f4 100644 --- a/.github/workflows/spell_checking.yml +++ b/.github/workflows/spell_checking.yml @@ -10,22 +10,13 @@ jobs: codespell: name: Check spelling of all files with codespell runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - uses: codespell-project/actions-codespell@v2 with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install codespell - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Check spelling with codespell - run: codespell --ignore-words=codespell.txt || exit 1 + check_filenames: true + check_hidden: true + ignore_words_file: codespell.txt misspell: name: Check spelling of all files in commit with misspell runs-on: ubuntu-latest From 5391cd32f3418cbb8c05ad08902559ce3ca1faca Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:25:31 +0100 Subject: [PATCH 2/7] Consistent naming of steps Follows https://github.com/rubocop/rubocop/commit/99592fcc1d57902aea39bc59b92cd6589f34a9d4 --- .github/workflows/rubocop.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index d72e3c2e9..b88a77995 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -48,10 +48,8 @@ jobs: # set TMPDIR, git core.autocrlf echo "TMPDIR=$env:RUNNER_TEMP" >> $GITHUB_ENV git config --system core.autocrlf false - - name: checkout - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: install dependencies @@ -79,8 +77,7 @@ jobs: name: Prism steps: - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: # Specify the minimum Ruby version 2.7 required for Prism to run. ruby-version: 2.7 @@ -110,10 +107,8 @@ jobs: # as well as very old specs & ancient ruby version - { rubocop: "v1.61.0", ruby: "2.7", os: ubuntu } steps: - - name: checkout - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: setup env @@ -143,10 +138,8 @@ jobs: ruby: ["3.0"] rubocop: [master] steps: - - name: checkout - uses: actions/checkout@v4 - - name: set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: install dependencies From 449835f7ce12b795560873e8becbeee8b8209c55 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:27:04 +0100 Subject: [PATCH 3/7] Remove `TEST_QUEUE_WORKERS` In https://github.com/rubocop/rubocop/commit/43105b4d55a0ee0ba58dd7e483936d0ac6905bf3 I found that not setting this is slightly faster for CI Doesn't matter much here but it's less clutter --- .github/workflows/rubocop.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index b88a77995..0d84341e0 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -20,8 +20,6 @@ jobs: runs-on: ${{ matrix.os }}-latest timeout-minutes: 5 env: - # See https://github.com/tmm1/test-queue#environment-variables - TEST_QUEUE_WORKERS: 2 RUBOCOP_VERSION: none JRUBY_OPTS: --dev # http://blog.headius.com/2019/09/jruby-startup-time-exploration.html TRUFFLERUBYOPT: --engine.Mode=latency # optimize for short test suites @@ -90,9 +88,6 @@ jobs: name: >- Main Gem Specs | RuboCop: ${{ matrix.rubocop }} | ${{ matrix.ruby }} runs-on: ${{ matrix.os }}-latest - env: - # See https://github.com/tmm1/test-queue#environment-variables - TEST_QUEUE_WORKERS: 2 strategy: fail-fast: false matrix: @@ -127,10 +122,6 @@ jobs: name: >- Coding Style | ${{ matrix.ruby }} runs-on: ${{ matrix.os }}-latest - env: - # See https://github.com/tmm1/test-queue#environment-variables - TEST_QUEUE_WORKERS: 2 - RUBOCOP_VERSION: master strategy: fail-fast: false matrix: From 4fa5b5127d9d57892fd7cc5567bba41b23054e92 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:29:46 +0100 Subject: [PATCH 4/7] Use `bundler-cache` for `ruby/setup-ruby` No need to call this yourself --- .github/workflows/rubocop.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 0d84341e0..c7660008e 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -50,8 +50,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: install dependencies - run: bundle install --jobs 3 --retry 3 + bundler-cache: true - name: code coverage if: matrix.coverage uses: paambaati/codeclimate-action@v9.0.0 @@ -133,7 +132,6 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: install dependencies - run: bundle install --jobs 3 --retry 3 + bundler-cache: true - name: internal investigation run: bundle exec rake generate internal_investigation From 3e4f5841d4df2480702d6bef54e575ffa91d3ff1 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:30:28 +0100 Subject: [PATCH 5/7] Add newlines between different jobs Makes it more pleasant to read --- .github/workflows/rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index c7660008e..9f6a01e9e 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -69,6 +69,7 @@ jobs: - name: spec if: "matrix.coverage != true && matrix.internal_investigation != true" run: bundle exec rake spec + prism: runs-on: ubuntu-latest name: Prism @@ -83,6 +84,7 @@ jobs: env: PARSER_ENGINE: parser_prism run: bundle exec rake prism_spec + rubocop_specs: name: >- Main Gem Specs | RuboCop: ${{ matrix.rubocop }} | ${{ matrix.ruby }} @@ -117,6 +119,7 @@ jobs: run: bundle exec rake generate - name: spec run: cd ../rubocop && bundle exec rake spec + internal_investigation: name: >- Coding Style | ${{ matrix.ruby }} From d4d120a100ef38924e10180b4ee43c97bfe15e57 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:33:54 +0100 Subject: [PATCH 6/7] Simplify `internal_investigation` RuboCop used to run `internal_investigation` in a matrix as well, but not anymore since https://github.com/rubocop/rubocop/pull/12964 Drop the matrix to simplify and use the latest stable ruby --- .github/workflows/rubocop.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 9f6a01e9e..bb4e886a9 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -67,7 +67,7 @@ jobs: if: matrix.os != 'windows' run: (! bundle exec rubocop -h 2> /dev/null) && echo 'RuboCop successfully *not* loaded for local tests' - name: spec - if: "matrix.coverage != true && matrix.internal_investigation != true" + if: "matrix.coverage != true" run: bundle exec rake spec prism: @@ -95,7 +95,6 @@ jobs: os: [ubuntu] ruby: [2.7] rubocop: [master] - internal_investigation: [null] include: # Instead of testing all possibilities, we test the extreme points of # a diagonal with the shiniest and latest @@ -121,20 +120,13 @@ jobs: run: cd ../rubocop && bundle exec rake spec internal_investigation: - name: >- - Coding Style | ${{ matrix.ruby }} - runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false - matrix: - os: [ubuntu] - ruby: ["3.0"] - rubocop: [master] + name: Coding Style + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: ruby # Latest stable CRuby version bundler-cache: true - name: internal investigation run: bundle exec rake generate internal_investigation From 42c9ccb6dc1e9d3b06eeebd07b48da8b5e35b4ca Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:47:54 +0100 Subject: [PATCH 7/7] Remove windows-specific CI step It was part of RuboCop for `internal_investigation`, where it is needed. But here, `internal_investigation` already was its own job step --- .github/workflows/rubocop.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index bb4e886a9..a9d9932d2 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -40,12 +40,6 @@ jobs: - { ruby: truffleruby-head, os: ubuntu } steps: - - name: windows misc - if: matrix.os == 'windows' - run: | - # set TMPDIR, git core.autocrlf - echo "TMPDIR=$env:RUNNER_TEMP" >> $GITHUB_ENV - git config --system core.autocrlf false - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: