From f7793bab6066e67bb401967b74ec38f1616e44f6 Mon Sep 17 00:00:00 2001 From: Tim Riley Date: Wed, 26 Nov 2025 09:31:34 +1100 Subject: [PATCH 1/5] Test on JRuby in CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c012e83..c4a6c124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: - "3.4" - "3.3" - "3.2" + - "jruby" rack: - "~> 2.0" - "~> 3.0" From d01a8986a72c962de8ad5443b40b6666662e5766 Mon Sep 17 00:00:00 2001 From: Tim Riley Date: Wed, 26 Nov 2025 09:58:03 +1100 Subject: [PATCH 2/5] Allow jruby failures? --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4a6c124..ebf6055c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: tests: runs-on: ubuntu-latest + continue-on-error: ${{ matrix.optional }} strategy: fail-fast: false matrix: @@ -17,10 +18,14 @@ jobs: - "3.4" - "3.3" - "3.2" - - "jruby" rack: - "~> 2.0" - "~> 3.0" + optional: [false] + include: + - ruby: "jruby" + rack: "~> 3.0" + optional: true name: tests (Ruby ${{ matrix.ruby }}, Rack ${{ matrix.rack }}) steps: - uses: actions/checkout@v1 @@ -34,9 +39,27 @@ jobs: env: RACK_VERSION_CONSTRAINT: ${{matrix.rack}} - name: Run all tests - run: script/ci + run: | + status=0 + script/ci || status=$? + if [ ${status} -ne 0 ] && [ "${{ matrix.optional }}" == "true" ]; then + echo "::warning::Optional matrix job failed." + echo "optional_fail=true" >> "${GITHUB_OUTPUT}" + echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" + exit 0 # Ignore error here to keep the green checkmark going + fi + exit ${status} env: RACK_VERSION_CONSTRAINT: ${{matrix.rack}} + - name: Comment for optional failures + uses: thollander/actions-comment-pull-request@v3 + if: ${{ matrix.optional }} + with: + # Note: tag must be unique to each matrix case + comment-tag: "${{ matrix.ruby }}-${{ matrix.rack }}-optional-notice" + message: | + **⚠️ Optional matrix job Ruby ${{ matrix.ruby }} - Rack ${{ matrix.rack }} failed** + mode: ${{ steps.test.outputs.optional_fail == 'true' && 'upsert' || 'delete' }} workflow-keepalive: if: github.event_name == 'schedule' From 806e8daa94538f4cc231327d3a2f5a8615b60097 Mon Sep 17 00:00:00 2001 From: Tim Riley Date: Wed, 26 Nov 2025 10:04:29 +1100 Subject: [PATCH 3/5] Permissions --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebf6055c..9a1bef13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,13 +2,17 @@ name: ci on: push: + branches: ["main"] + tags: ["v*"] pull_request: - create: + branches: ["main"] schedule: - cron: "30 4 * * *" jobs: tests: + permissions: + pull-requests: write runs-on: ubuntu-latest continue-on-error: ${{ matrix.optional }} strategy: @@ -51,14 +55,13 @@ jobs: exit ${status} env: RACK_VERSION_CONSTRAINT: ${{matrix.rack}} - - name: Comment for optional failures + - name: Add comment for optional failures uses: thollander/actions-comment-pull-request@v3 if: ${{ matrix.optional }} with: - # Note: tag must be unique to each matrix case comment-tag: "${{ matrix.ruby }}-${{ matrix.rack }}-optional-notice" message: | - **⚠️ Optional matrix job Ruby ${{ matrix.ruby }} - Rack ${{ matrix.rack }} failed** + **⚠️ Optional job failed: Ruby ${{ matrix.ruby }} - Rack ${{ matrix.rack }}** mode: ${{ steps.test.outputs.optional_fail == 'true' && 'upsert' || 'delete' }} workflow-keepalive: From 3ba92fc52cc7995274e10d4f70182e3edaff7674 Mon Sep 17 00:00:00 2001 From: Tim Riley Date: Wed, 26 Nov 2025 10:10:25 +1100 Subject: [PATCH 4/5] Add missing step ID --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a1bef13..e89698ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: env: RACK_VERSION_CONSTRAINT: ${{matrix.rack}} - name: Run all tests + id: test run: | status=0 script/ci || status=$? From e4abc71f78283df735ad9bdb3c0604e703d70724 Mon Sep 17 00:00:00 2001 From: Tim Riley Date: Wed, 26 Nov 2025 10:16:04 +1100 Subject: [PATCH 5/5] Tweak comment --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e89698ad..c851acbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: with: comment-tag: "${{ matrix.ruby }}-${{ matrix.rack }}-optional-notice" message: | - **⚠️ Optional job failed: Ruby ${{ matrix.ruby }} - Rack ${{ matrix.rack }}** + **⚠️ Optional job failed:** Ruby ${{ matrix.ruby }} / Rack ${{ matrix.rack }} mode: ${{ steps.test.outputs.optional_fail == 'true' && 'upsert' || 'delete' }} workflow-keepalive: