From 43edacb4dd0c1ff0ae89289a101aba28cb39ed23 Mon Sep 17 00:00:00 2001 From: Howard Huang Date: Fri, 29 May 2026 01:06:24 -0500 Subject: [PATCH] CHORE: Split CI into separate test and rubocop jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What: Replaces the single `build` job that ran `bundle exec rake` with two parallel jobs — `test` (runs `bundle exec rake test`) and `rubocop` (runs `bundle exec rake rubocop`). Workflow renamed Ruby -> CI to reflect the broader scope. Why: Separate jobs give clearer signal in PR check lists (test/rubocop failures are distinct red Xs instead of one combined status), and they execute in parallel — faster feedback per PR. Also adds: - concurrency block keyed on workflow + ref, with cancel-in-progress so a force-push to a PR cancels the previous in-flight run instead of doubling CI usage. - fail-fast: false on the test matrix so a single Ruby version failure doesn't cancel siblings (useful once the matrix grows past the current single 4.0.5 entry). Same Ruby version (4.0.5), same actions/checkout@v6 and ruby/setup-ruby@v1 with bundler-cache enabled. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/main.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 720cd42..f70daca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,24 +1,27 @@ -name: Ruby +name: CI on: push: branches: - main - pull_request: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - build: + test: runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} + name: Test (Ruby ${{ matrix.ruby }}) strategy: + fail-fast: false matrix: ruby: - '4.0.5' - steps: - uses: actions/checkout@v6 with: @@ -28,5 +31,20 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Run the default task - run: bundle exec rake + - name: Run tests + run: bundle exec rake test + + rubocop: + runs-on: ubuntu-latest + name: Rubocop + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '4.0.5' + bundler-cache: true + - name: Run Rubocop + run: bundle exec rake rubocop