Skip CI tests for non-code changes (#673)

* 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 <noreply@anthropic.com>

* 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 <noreply@anthropic.com>
This commit is contained in:
Taro L. Saito 2025-07-19 09:05:07 -07:00 committed by GitHub
parent 57def01ca4
commit 066b9af9c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,23 @@ name: CI
on:
pull_request:
paths:
push:
branches:
- master
- main
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'
@ -11,21 +27,13 @@ on:
- '**.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:
- '.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