Optimize CI/CD triggers to skip builds on non-source changes

This commit is contained in:
Niko Savola 2026-06-05 11:58:15 +03:00
parent 6270877110
commit b0bdc73a44
No known key found for this signature in database
2 changed files with 67 additions and 0 deletions

View File

@ -13,7 +13,34 @@ on:
types: [published]
jobs:
changes:
name: Check for source changes
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code == 'true' || github.event_name == 'release' }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
if: github.event_name != 'release'
with:
filters: |
code:
- '!**/*.md'
- '!docs/**'
- '!samples/**'
- '!Jenkinsfile*'
- '!.travis.yml'
- '!dropbox-deployment.yml'
- '!.gitignore'
- '!LICENSE'
- '!COPYRIGHT'
- '!CONTRIB'
- '!Changelog*'
build:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@ -106,6 +133,8 @@ jobs:
# The following was taken from https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/
make_sdist:
name: Make SDist
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

View File

@ -7,6 +7,44 @@ trigger:
tags:
include:
- 'v*'
paths:
exclude:
- '*.md'
- docs/*
- samples/*
- etc/*
- macbuild/*
- ci-scripts/*
- scripts/*
- .travis.yml
- Jenkinsfile*
- .gitignore
- LICENSE
- COPYRIGHT
- CONTRIB
- Changelog*
pr:
branches:
include:
- master
- staging
paths:
exclude:
- '*.md'
- docs/*
- samples/*
- etc/*
- macbuild/*
- ci-scripts/*
- scripts/*
- .travis.yml
- Jenkinsfile*
- .gitignore
- LICENSE
- COPYRIGHT
- CONTRIB
- Changelog*
jobs:
- job: Build