From d0112d9258cb40dde786de02d5a33e097c59b367 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Sun, 22 Nov 2026 09:01:47 -0500 Subject: [PATCH] Speed up CI Run JRuby with --dev, which roughly halves its JVM startup-bound bundle and test steps, the slowest job in every run. Key the bundler cache by JSON version so the Ruby 3.2 JSON 2 job no longer restores the JSON 3 bundle and recompiles json. Only build pushes to master and cancel superseded pull request runs, so same-repo branches aren't built twice. Update actions/checkout to v7, since v3's Node runtime is retired. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_011Gr21htyJfr8XZGHBcPwkW --- .github/workflows/coverage.yml | 11 +++++++++-- .github/workflows/lint.yml | 11 +++++++++-- .github/workflows/test.yml | 15 +++++++++++++-- CHANGELOG.md | 1 + 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 29edbf0..3790d10 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,13 @@ --- name: coverage -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: COVERAGE: 1 @@ -9,7 +16,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: ruby-version: '4.0' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 76ba84a..4e7fff6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,12 +1,19 @@ name: lint -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: rubocop: name: RuboCop runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v7 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ab052d..c789b36 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,13 @@ --- name: test -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: test: runs-on: ${{ matrix.entry.os || 'ubuntu-latest' }} @@ -18,11 +25,15 @@ jobs: name: test (Ruby ${{ matrix.entry.ruby }}, JSON ${{ matrix.entry.json || '3' }}) env: JSON_VERSION: ${{ matrix.entry.json || '3' }} + # Speeds up JRuby startup, which dominates its bundle and test steps. CRuby ignores it. + JRUBY_OPTS: --dev steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.entry.ruby }} bundler-cache: true + # Gemfile.lock isn't committed, so keep JSON 2 and JSON 3 bundles from restoring each other's cache. + cache-version: json-${{ matrix.entry.json || '3' }} - run: bundle exec rake test spinach continue-on-error: ${{ matrix.entry.allowed-failure || false }} diff --git a/CHANGELOG.md b/CHANGELOG.md index cdbadf6..2ea0959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * [#336](https://github.com/codegram/hyperclient/pull/336): Fixed `SystemStackError` when iterating a link whose resource links back to itself under the same name, raising `Hyperclient::SelfReferencingLinkError` instead - [@dblock](https://github.com/dblock). * [#337](https://github.com/codegram/hyperclient/pull/337): Updated danger-pr-comment to 0.3.0 and stopped posting empty Danger reports - [@dblock](https://github.com/dblock). * [#338](https://github.com/codegram/hyperclient/pull/338): Documented link properties, including HAL `profile` via `Link#_profile` - [@dblock](https://github.com/dblock). +* [#339](https://github.com/codegram/hyperclient/pull/339): Sped up CI by running JRuby with `--dev`, separating JSON 2 and JSON 3 bundler caches, skipping duplicate branch builds, and updating `actions/checkout` to v7 - [@dblock](https://github.com/dblock). * Your contribution here. ### 2.1.0 (2026/10/14)