From b0bdc73a4492bef9ec2a68210d6d0afc895384b4 Mon Sep 17 00:00:00 2001 From: Niko Savola Date: Fri, 5 Jun 2026 11:58:15 +0300 Subject: [PATCH] Optimize CI/CD triggers to skip builds on non-source changes --- .github/workflows/build.yml | 29 ++++++++++++++++++++++++++++ azure-pipelines.yml | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33a57a8c9..3dd25089c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1d0ca1430..d266f9072 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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