Skip to content

CI: Reduce Action runs via trigger fix, concurrency, path filtering, and pip caching #518

@zrgt

Description

@zrgt

Summary

The current CI workflow triggers too many unnecessary Action runs. Four issues identified:

Problem 1 — Double Triggers (~50% run reduction)

on: [push, pull_request] causes every PR commit to trigger two runs (one for push, one for pull_request).

Fix:

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

Problem 2 — No Concurrency / Cancel

Rapid successive commits cause all queued runs to complete, wasting runner minutes.

Fix — top-level in ci.yml:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Problem 3 — No Path Filtering

A change in server/ still triggers all SDK and compliance-tool jobs.

Fix — per job with paths filter:

# sdk jobs
on:
  push:
    paths:
      - 'sdk/**'
      - '.github/workflows/ci.yml'

# compliance-tool jobs
on:
  push:
    paths:
      - 'compliance_tool/**'
      - 'sdk/**'

# server jobs
on:
  push:
    paths:
      - 'server/**'
      - 'sdk/**'

Note: path filtering at job level requires either separate workflow files per package or use of jobs.<job>.if with github.event.head_commit path checks.

Problem 4 — No pip Caching

All 12 jobs install dependencies from scratch on every run.

Fix — add cache: 'pip' to every actions/setup-python step:

- uses: actions/setup-python@v5
  with:
    python-version: ${{ env.X_PYTHON_MIN_VERSION }}
    cache: 'pip'

Impact Summary

# Problem Impact Effort
1 Double triggers ~50% fewer runs Low
2 No concurrency/cancel Eliminates waste on rapid pushes Low
3 No path filtering Skips irrelevant jobs Medium
4 No pip caching Faster runs Low

Recommendation: Fix problems 1 and 2 first — immediate impact, zero risk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions