From 066b9af9c246d3acafe101050c83107659e9e6ab Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Sat, 19 Jul 2025 09:05:07 -0700 Subject: [PATCH] Skip CI tests for non-code changes (#673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Skip CI tests for non-code changes - Add dorny/paths-filter to detect code changes - Run actual tests only when code/build files change - Add skip jobs to satisfy required status checks - Reduces CI time for documentation-only changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * Add .scalafmt.conf to code change detection - Ensures code format check runs when scalafmt config changes - Important for maintaining consistent code formatting rules * Add sbt launcher scripts to code change detection - Includes sbt and sbt.bat in path filters - Ensures tests run when build scripts are modified * Remove test documentation file - No longer needed for PR demonstration - PR description already explains the changes * Remove test-jdk skip jobs - Remove unnecessary skip jobs for JDK tests - Keep only code_format_skip for required status check * Remove all skip jobs - Remove code_format_skip job - Simplify workflow to only run tests when code changes detected --------- Co-authored-by: Claude --- .github/workflows/test.yml | 42 +++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index faeacd0..ff73ba7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,30 +2,38 @@ name: CI on: pull_request: - paths: - - '**.scala' - - '**.java' - - '**.sbt' - - '.github/workflows/*.yml' - - '**.so' - - '**.dll' - - 'src/main/resources/**' - - 'project/build.properties' push: branches: - master - main - paths: - - '**.scala' - - '**.java' - - '**.sbt' - - '.github/workflows/*.yml' - - 'src/main/resources/org/xerial/snappy/**' - - 'project/build.properties' jobs: + changes: + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + code: + - '**.scala' + - '**.java' + - '**.sbt' + - '.github/workflows/*.yml' + - '**.so' + - '**.dll' + - 'src/main/resources/**' + - 'project/build.properties' + - '.scalafmt.conf' + - 'sbt' + - 'sbt.bat' code_format: name: code format + needs: changes + if: ${{ needs.changes.outputs.code == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -36,6 +44,8 @@ jobs: matrix: version: [ '8', '11', '17', '21' ] name: test jdk${{ matrix.version }} + needs: changes + if: ${{ needs.changes.outputs.code == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4