Skip to content

GH workflows only trigger for relevant parts of the code base - #194

Open
douglowe wants to merge 4 commits into
developfrom
193-only-trigger-gh-workflows-for-relevant-parts-of-the-code-base
Open

GH workflows only trigger for relevant parts of the code base#194
douglowe wants to merge 4 commits into
developfrom
193-only-trigger-gh-workflows-for-relevant-parts-of-the-code-base

Conversation

@douglowe

@douglowe douglowe commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

The unit test, integration test, and code linting workflows only run on changes to the app and tests directories:

on:
  pull_request:
    branches: [ develop ]
    paths:
      - app/**
      - tests/**

@douglowe douglowe linked an issue Jul 27, 2026 that may be closed by this pull request
@douglowe douglowe self-assigned this Jul 27, 2026
@douglowe
douglowe force-pushed the 193-only-trigger-gh-workflows-for-relevant-parts-of-the-code-base branch from 04f9a07 to 4284b61 Compare July 27, 2026 10:52
@douglowe
douglowe marked this pull request as ready for review July 27, 2026 10:55
@douglowe
douglowe requested review from alexhambley and Copilot July 27, 2026 10:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR narrows when GitHub Actions workflows run on pull_request events by adding paths filters, aiming to trigger CI only when relevant parts of the repository change.

Changes:

  • Added on.pull_request.paths filters to unit tests, integration tests, and lint workflows.
  • Limited workflow triggers to changes under app/** and tests/**.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/unit_tests.yml Restricts unit test workflow triggers to app/** and tests/**.
.github/workflows/test_docker.yml Restricts integration test workflow triggers to app/** and tests/**.
.github/workflows/lint.yml Restricts lint workflow triggers to app/** and tests/**.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/unit_tests.yml Outdated
Comment thread .github/workflows/test_docker.yml
Comment thread .github/workflows/lint.yml
Ensure that we check dependencies, docker build scripts, and docker compose files.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@alexhambley alexhambley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made me look at our CI coverage more broadly, and I'd like us to consider a few things before merging:

  1. The workflows can't trigger themselves, so a PR that only touches .github/workflows/ (e.g., changing these filters, or bumping the Python version) would run no CI at all. I'd suggest adding .github/workflows/** to each list.

  2. We currently have no CI on merges. These workflows only run on pull_request, so nothing runs when a PR reaches develop/main. This was OK before these changes, but with path filtering added on top, we need a push trigger as a safety net, e.g something like:

on:
  push:
    branches: [ develop, main ]
  pull_request:
    branches: [ develop, main ]
    paths:
      ...

Another thing (maybe for issue #193 rather than here): if we ever make these checks required, fltered workflows never report a status, so docs-only PRs for example would sit on "expected" forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only trigger GH workflows for relevant parts of the code base

3 participants