CI: single source of truth#5267
Conversation
… a single source of truth, and do some syntax cleanup
…let's go along with it this for safety
There was a problem hiding this comment.
Pull request overview
This PR introduces a reusable GitHub Actions workflow intended to centralize shared CI defaults (e.g., Python version, cache keys/paths) and updates existing workflows to consume those outputs, reducing repetition across workflow files. It also includes a few small cleanups of unreachable code and adjusts the search example’s data download script to try using a local cache.
Changes:
- Added
.github/workflows/workflow-defaults.ymlreusable workflow to publish shared outputs (Python version, cache key(s), paths) and perform some caching. - Updated multiple CI workflows to call
workflow-defaults.ymland reference its outputs instead of hardcoding values. - Removed unreachable code in a couple of Python modules and updated
examples/search/get.shto avoid re-downloading files when already present.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pycbc/scheme.py |
Removes unreachable break after return. |
pycbc/distributions/joint.py |
Removes unreachable assignment after early return. |
pycbc/__init__.py |
Adds pylint suppression for an intentionally-unused argument in formatTime. |
examples/search/get.sh |
Adds “use local cache if present” logic for frame downloads. |
.github/workflows/workflow-tests.yml |
Adds defaults workflow usage and attempts to consume its outputs. |
.github/workflows/workflow-defaults.yml |
New reusable workflow exporting defaults and attempting to manage caches. |
.github/workflows/tmpltbank-workflow.yml |
Uses defaults workflow output for Python version. |
.github/workflows/search-workflow.yml |
Adds restore-cache steps and uses defaults workflow output for Python version. |
.github/workflows/mac-test.yml |
YAML indentation/formatting adjustments. |
.github/workflows/inference-workflow.yml |
Uses defaults workflow output for Python version. |
.github/workflows/distribution.yml |
YAML indentation/formatting adjustments. |
.github/workflows/check_code.yml |
Reworks linter workflow and uses defaults workflow output for Python version. |
.github/workflows/basic-tests.yml |
Uses defaults workflow output for LAL data path and adds defaults workflow dependency. |
.github/workflows/bank-compress-workflow.yml |
Uses defaults workflow output for Python version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2a56791 to
554b8a2
Compare
| - name: Install system packages | ||
| run: | | ||
| set -euxo pipefail | ||
| sudo apt-get -o Acquire::Retries=3 install -y *fftw3* intel-mkl* mpi graphviz |
There was a problem hiding this comment.
Note that here I have included a few things which weren't used everywhere, but I don think it is too expensive to run these install as well?
| matrix: | ||
| os: [ubuntu-24.04] | ||
| python-version: ['3.11', '3.12', '3.13'] | ||
| python_version: ['3.11', '3.12', '3.13'] |
There was a problem hiding this comment.
The - in GitHub variables can sometimes be misconstrued as negation, so underscores are safer
This is an attempt to have single sources of truth defined for the CI workflows. As a few of the workflows use the same information, it would be good to reuse it without the repetition across files.
Standard information about the request
This change follows style guidelines (See e.g. PEP8), has been proposed using the contribution guidelines
Motivation
Single source of truth
Contents
Add a new GitHub actions, to be called by the workflows. This defines a single source of truth which is then inherited by the other workflows
Testing performed
this seems to work in the act tests performed, but these have not been extensive