Skip to content

Comments

CI: single source of truth#5267

Open
GarethCabournDavies wants to merge 19 commits intogwastro:masterfrom
GarethCabournDavies:ci_single_source_of_truth
Open

CI: single source of truth#5267
GarethCabournDavies wants to merge 19 commits intogwastro:masterfrom
GarethCabournDavies:ci_single_source_of_truth

Conversation

@GarethCabournDavies
Copy link
Contributor

@GarethCabournDavies GarethCabournDavies commented Jan 26, 2026

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

  • The author of this pull request confirms they will adhere to the code of conduct

Copilot AI review requested due to automatic review settings January 26, 2026 16:52
Copy link
Contributor

Copilot AI left a comment

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 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.yml reusable workflow to publish shared outputs (Python version, cache key(s), paths) and perform some caching.
  • Updated multiple CI workflows to call workflow-defaults.yml and reference its outputs instead of hardcoding values.
  • Removed unreachable code in a couple of Python modules and updated examples/search/get.sh to 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.

- name: Install system packages
run: |
set -euxo pipefail
sudo apt-get -o Acquire::Retries=3 install -y *fftw3* intel-mkl* mpi graphviz
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The - in GitHub variables can sometimes be misconstrued as negation, so underscores are safer

@GarethCabournDavies GarethCabournDavies added the github_actions Pull requests that update GitHub Actions code label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant