Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
11639a4
Add unused variable check to flake8, use vulture for unreachable code
GarethCabournDavies Jan 23, 2026
c40595a
Make changes to workflo files, add workflow defaults so that there is…
GarethCabournDavies Jan 23, 2026
c8a49fc
revert distribution.yml to have explicit versions
GarethCabournDavies Jan 23, 2026
1c78d4d
Remove cache default
GarethCabournDavies Jan 23, 2026
5fca205
revert un-needed changes
GarethCabournDavies Jan 23, 2026
a42a0ff
Fix the workflow defaults job
GarethCabournDavies Jan 23, 2026
a7804ce
Fail only on unused imports, report on unused variables
GarethCabournDavies Jan 23, 2026
da405a6
Revert to previously-working test syntax
GarethCabournDavies Jan 23, 2026
f098f98
Remove unreachable code so that tests can actually pass
GarethCabournDavies Jan 23, 2026
44e3f08
Copilot says that the defaults code won't work, it seems to work but …
GarethCabournDavies Jan 23, 2026
882b5e2
Add caching to the search workflow
GarethCabournDavies Jan 26, 2026
42e05d1
Add file caching to the shared workflow defaults
GarethCabournDavies Jan 26, 2026
040009a
remove comment
GarethCabournDavies Jan 26, 2026
554b8a2
remove unrelated changes
GarethCabournDavies Jan 27, 2026
8827a5a
copilot siuggestions / yaml should supposedly have this at the start …
GarethCabournDavies Jan 27, 2026
b5c309f
use actions for single source of truth
GarethCabournDavies Jan 27, 2026
3e6d068
add shell to defaults action
GarethCabournDavies Jan 27, 2026
9f09386
add shell to other action runs
GarethCabournDavies Jan 27, 2026
309e836
Merge branch 'gwastro:master' into ci_single_source_of_truth
GarethCabournDavies Jan 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/bank-compress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ concurrency:
cancel-in-progress: true

jobs:
workflow_defaults:
uses: ./.github/workflows/workflow-defaults.yml
build:
needs: workflow_defaults
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ needs.workflow_defaults.outputs.python_version }}
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
41 changes: 6 additions & 35 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ concurrency:
cancel-in-progress: true

jobs:
workflow_defaults:
uses: ./.github/workflows/workflow-defaults.yml

build:
needs: workflow_defaults
runs-on: ${{ matrix.os }}
env:
LAL_DATA_PATH: ${{ needs.workflow_defaults.outputs.lal_data_path }}
strategy:
max-parallel: 60
matrix:
Expand All @@ -26,51 +32,16 @@ jobs:
sudo apt-get -o Acquire::Retries=3 update
sudo apt-get -o Acquire::Retries=3 install *fftw3* mpi intel-mkl* graphviz
pip install tox pip setuptools --upgrade
Comment thread
GarethCabournDavies marked this conversation as resolved.
- name: Cache LAL auxiliary data files
id: cache-lal-aux-data
uses: actions/cache@v4
with:
key: lal-aux-data
path: ~/lal_aux_data
- if: ${{ steps.cache-lal-aux-data.outputs.cache-hit != 'true' }}
name: Download LAL auxiliary data files
run: |
mkdir ~/lal_aux_data
pushd ~/lal_aux_data
curl --show-error --silent \
--remote-name https://zenodo.org/records/14999310/files/SEOBNRv4ROM_v2.0.hdf5 \
--remote-name https://zenodo.org/records/14999310/files/SEOBNRv4ROM_v3.0.hdf5
popd
- name: Cache example GW data
id: cache-example-gw-data
uses: actions/cache@v4
with:
key: example-gw-data
path: |
docs/_include/*_TDI_v2.gwf
docs/_include/*_GWOSC_4KHZ_R1-1126257415-4096.gwf
docs/_include/*_LOSC_CLN_4_V1-1187007040-2048.gwf
examples/inference/lisa_smbhb_ldc/*_psd.txt
examples/inference/lisa_smbhb_ldc/*_TDI_v2.gwf
examples/inference/lisa_smbhb_ldc/MBHB_params_v2_LISA_frame.pkl
examples/inference/margtime/*.gwf
examples/inference/multisignal/*.gwf
examples/inference/relative/*.gwf
examples/inference/relmarg/*.gwf
examples/inference/single/*.gwf
- name: run pycbc test suite
run: |
export LAL_DATA_PATH=$HOME/lal_aux_data
tox -e py-${{matrix.test-type}}
- name: check help messages work
if: matrix.test-type == 'unittest'
run: |
export LAL_DATA_PATH=$HOME/lal_aux_data
tox -e py-help
- name: run inference tests
if: matrix.test-type == 'search'
run: |
export LAL_DATA_PATH=$HOME/lal_aux_data
tox -e py-inference
- name: store documentation page
if: matrix.test-type == 'docs' && matrix.python-version == '3.12'
Expand Down
63 changes: 43 additions & 20 deletions .github/workflows/check_code.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
name: Flake8 check
name: Code quality checks
on: [pull_request]
jobs:
flake8_unused_imports:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install flake8
run: pip install flake8
- name: Checking executables for unused imports
run: flake8 --select=F401 $(find bin -type f -name pycbc_*)
- name: Checking modules for unused imports
run: |
flake8 --select=F401 $(find pycbc | grep '\.py$' | grep -v -e __init__ -e 'version.py')
- name: Checking tests for unused imports
run: |
flake8 --select=F401 $(find test | grep '\.py$' | grep -v test_schemes)
workflow_defaults:
uses: ./.github/workflows/workflow-defaults.yml

linters:
needs: workflow_defaults
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ needs.workflow_defaults.outputs.python_version }}
- name: Install linters
run: pip install flake8 vulture pylint

- name: Check executables for unused imports
run: flake8 --select=F401 $(find bin -type f -name pycbc_*)
- name: Check executables for unused variables (report only)
run: flake8 --select=F841 $(find bin -type f -name pycbc_*) || true
- name: Check modules for unused imports
run: |
flake8 --select=F401 $(find pycbc | grep '\.py$' | grep -v -e __init__ -e 'version.py')
- name: Check modules for unused variables (report only)
run: |
flake8 --select=F841 $(find pycbc | grep '\.py$' | grep -v -e __init__ -e 'version.py') || true
- name: Check tests for unused imports
run: |
flake8 --select=F401 $(find test | grep '\.py$' | grep -v test_schemes)
- name: Check tests for unused variables (report only)
run: |
flake8 --select=F841 $(find test | grep '\.py$' | grep -v test_schemes) || true
- name: Check for unreachable code
run: |
# Run pylint only for unreachable code. Disable all other messages.
python -m pylint --disable=all --enable=unreachable pycbc || true
# pylint exits with non-zero when messages are emitted; fail if any found
if python -m pylint --disable=all --enable=unreachable pycbc | grep -q "unreachable"; then
echo "Unreachable code found by pylint"; exit 1
fi

- name: Checking for unused codes (report only)
run: vulture pycbc --min-confidence 100 || true
46 changes: 23 additions & 23 deletions .github/workflows/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ jobs:
runs-on: ubuntu-24.04
needs: build_wheels
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/download-artifact@v4.1.7
with:
pattern: wheel-*
merge-multiple: true
path: dist/
- name: Build source distribution
run: |
python -c 'import setuptools ; print("setuptools version", setuptools.__version__)'
pip install pip setuptools --upgrade
python setup.py sdist
ls -lh dist
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
password: ${{ secrets.pypi_password }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/download-artifact@v4.1.7
with:
pattern: wheel-*
merge-multiple: true
path: dist/
- name: Build source distribution
run: |
python -c 'import setuptools ; print("setuptools version", setuptools.__version__)'
pip install pip setuptools --upgrade
python setup.py sdist
ls -lh dist
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
password: ${{ secrets.pypi_password }}
5 changes: 4 additions & 1 deletion .github/workflows/inference-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ name: run small inference workflow using pegasus + condor
on: [push, pull_request]

jobs:
workflow_defaults:
uses: ./.github/workflows/workflow-defaults.yml
build:
needs: workflow_defaults
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ needs.workflow_defaults.outputs.python_version }}
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
64 changes: 32 additions & 32 deletions .github/workflows/mac-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,35 @@ jobs:
shell: bash -el {0}

steps:
- uses: actions/checkout@v1

- name: Cache conda packages
uses: actions/cache@v4
env:
# increment to reset cache
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ matrix.python-version}}-${{ env.CACHE_NUMBER }}

- name: Configure conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge
miniforge-version: latest
python-version: ${{ matrix.python-version }}

- name: Conda info
run: conda info --all

- name: Install tox
run: |
conda install \
pip \
setuptools \
tox

- name: Run basic pycbc test suite
run: |
tox -e py-unittest
- uses: actions/checkout@v1

- name: Cache conda packages
uses: actions/cache@v4
env:
# increment to reset cache
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ matrix.python-version}}-${{ env.CACHE_NUMBER }}

- name: Configure conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge
miniforge-version: latest
python-version: ${{ matrix.python-version }}

- name: Conda info
run: conda info --all

- name: Install tox
run: |
conda install \
pip \
setuptools \
tox

- name: Run basic pycbc test suite
run: |
tox -e py-unittest
25 changes: 24 additions & 1 deletion .github/workflows/search-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,40 @@ concurrency:
cancel-in-progress: true

jobs:
workflow_defaults:
uses: ./.github/workflows/workflow-defaults.yml
build:
needs: workflow_defaults
runs-on: ubuntu-24.04
timeout-minutes: 90
env:
PEGASUS_METRICS: 'false'
steps:
- uses: actions/checkout@v1
- name: Restore LAL auxiliary data cache
id: restore-lal
uses: actions/cache@v4
with:
key: lal-aux-data
path: |
~/lal_aux_data

- name: Restore example GW data cache for search example
id: restore-example-gw
uses: actions/cache@v4
with:
key: ${{ needs.workflow_defaults.outputs.example_gw_cache_key }}
path: |
examples/search
Comment thread
GarethCabournDavies marked this conversation as resolved.
Outdated

- name: list restored example files
run: |
echo "Restored files in examples/search:"
ls -la examples/search || true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ needs.workflow_defaults.outputs.python_version }}
- name: install condor
run: |
wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add -
Expand Down
Loading
Loading