From 9c0b656c4044974b62c8389be321d395f5f773bd Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Wed, 29 Oct 2025 12:00:41 -0400 Subject: [PATCH] ci: add path filters to skip tests on docs-only changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add path-based triggers to workflow to run tests only when relevant files change. This saves CI resources on documentation-only or README changes while maintaining broad coverage for code and configuration changes. Tests now run when these files change: - install.sh (installer script) - src/** (all source code) - tests/** (test files) - .github/workflows/** (CI configuration) - *.txt, *.toml, *.cfg (dependency/config files) - *.py (Python files in root) Tests skip when only these change: - README.md, docs, examples - Other markdown or documentation files This is especially beneficial for ARM tests which take 5-10 minutes due to QEMU emulation overhead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e98bf3b..d7a4b24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,13 +3,57 @@ name: Tests on: push: branches: [ "*" ] + paths: + - 'install.sh' + - 'src/**' + - 'tests/**' + - '.github/workflows/**' + - '*.txt' # requirements files + - '*.toml' # pyproject.toml + - '*.cfg' # setup.cfg + - '*.py' # any Python file in root pull_request: branches: [ "*" ] + paths: + - 'install.sh' + - 'src/**' + - 'tests/**' + - '.github/workflows/**' + - '*.txt' # requirements files + - '*.toml' # pyproject.toml + - '*.cfg' # setup.cfg + - '*.py' # any Python file in root jobs: + # Detect which files changed to run only relevant tests + detect-changes: + name: Detect Changes + runs-on: ubuntu-latest + outputs: + python: ${{ steps.filter.outputs.python }} + installer: ${{ steps.filter.outputs.installer }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + python: + - 'src/**/*.py' + - 'tests/test_*.py' + - '*.txt' + - '*.toml' + - '*.cfg' + installer: + - 'install.sh' + - 'tests/test_installer.sh' + - '.github/workflows/test.yml' + unit-tests: name: Unit Tests runs-on: ubuntu-latest + needs: detect-changes + if: needs.detect-changes.outputs.python == 'true' strategy: matrix: