Skip to content

Skip CI tests for non-code changes using dorny/paths-filter #901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,42 @@ name: CI

on:
pull_request:
paths:
- '**.scala'
- '**.java'
- '**.sbt'
- '.github/workflows/**.yml'
- 'project/build.properties'
push:
branches:
- main
paths:
- '**.scala'
- '**.java'
- '**.sbt'
- '.github/workflows/**.yml'
- 'project/build.properties'
workflow_dispatch:
workflow_dispatch:

jobs:
changes:
runs-on: ubuntu-latest
outputs:
code: ${{ steps.changes.outputs.code }}
docs: ${{ steps.changes.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
code:
- '**.scala'
- '**.java'
- '**.sbt'
- '.github/workflows/**.yml'
- 'project/build.properties'
- 'msgpack-core/**'
- 'msgpack-jackson/**'
docs:
- '**.md'
- '**.txt'
- 'LICENSE'

code_format:
name: Code Format
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
steps:
- uses: actions/checkout@v4
- name: jcheckstyle
Expand All @@ -31,6 +46,8 @@ jobs:
test:
name: Test JDK${{ matrix.java }}
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
strategy:
matrix:
java: ['8', '11', '17', '21', '24']
Expand Down
Loading