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,30 +2,38 @@ name: CI
on: on:
pull_request: pull_request:
paths:
- '**.scala'
- '**.java'
- '**.sbt'
- '.github/workflows/*.yml'
- '**.so'
- '**.dll'
- 'src/main/resources/**'
- 'project/build.properties'
push: push:
branches: branches:
- master - master
- main - main
paths:
- '**.scala'
- '**.java'
- '**.sbt'
- '.github/workflows/*.yml'
- 'src/main/resources/org/xerial/snappy/**'
- 'project/build.properties'
jobs: 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: code_format:
name: code format name: code format
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -36,6 +44,8 @@ jobs:
matrix: matrix:
version: [ '8', '11', '17', '21' ] version: [ '8', '11', '17', '21' ]
name: test jdk${{ matrix.version }} name: test jdk${{ matrix.version }}
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4