-
Notifications
You must be signed in to change notification settings - Fork 376
CI: single source of truth #5267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GarethCabournDavies
wants to merge
19
commits into
gwastro:master
Choose a base branch
from
GarethCabournDavies:ci_single_source_of_truth
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all 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 c40595a
Make changes to workflo files, add workflow defaults so that there is…
GarethCabournDavies c8a49fc
revert distribution.yml to have explicit versions
GarethCabournDavies 1c78d4d
Remove cache default
GarethCabournDavies 5fca205
revert un-needed changes
GarethCabournDavies a42a0ff
Fix the workflow defaults job
GarethCabournDavies a7804ce
Fail only on unused imports, report on unused variables
GarethCabournDavies da405a6
Revert to previously-working test syntax
GarethCabournDavies f098f98
Remove unreachable code so that tests can actually pass
GarethCabournDavies 44e3f08
Copilot says that the defaults code won't work, it seems to work but …
GarethCabournDavies 882b5e2
Add caching to the search workflow
GarethCabournDavies 42e05d1
Add file caching to the shared workflow defaults
GarethCabournDavies 040009a
remove comment
GarethCabournDavies 554b8a2
remove unrelated changes
GarethCabournDavies 8827a5a
copilot siuggestions / yaml should supposedly have this at the start …
GarethCabournDavies b5c309f
use actions for single source of truth
GarethCabournDavies 3e6d068
add shell to defaults action
GarethCabournDavies 9f09386
add shell to other action runs
GarethCabournDavies 309e836
Merge branch 'gwastro:master' into ci_single_source_of_truth
GarethCabournDavies File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: Defaults | ||
| description: "Composite action that exposes default values for workflows (e.g., python_version)." | ||
|
|
||
| inputs: | ||
| python-version: | ||
| description: "Default Python version to use in workflows" | ||
| required: false | ||
| default: '3.11' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - id: set | ||
| run: | | ||
| echo "python_version=${{ inputs.python-version }}" >> $GITHUB_OUTPUT | ||
| shell: bash | ||
|
|
||
| outputs: | ||
| python_version: | ||
| description: "Python version string" | ||
| value: ${{ steps.set.outputs.python_version }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Install HTCondor and Pegasus | ||
| description: "Composite action to install HTCondor and Pegasus on Ubuntu runners." | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Install HTCondor | ||
| shell: bash | ||
| run: | | ||
| wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu/HTCondor-Release.gpg.key | sudo apt-key add - | ||
| echo "deb http://research.cs.wisc.edu/htcondor/ubuntu/8.9/focal focal contrib" | sudo tee -a /etc/apt/sources.list | ||
| echo "deb-src http://research.cs.wisc.edu/htcondor/ubuntu/8.9/focal focal contrib" | sudo tee -a /etc/apt/sources.list | ||
| sudo apt-get -o Acquire::Retries=3 update | ||
| sudo apt-get -o Acquire::Retries=3 install -y minihtcondor | ||
| # systemd may not be available in all runners, ignore failures when enabling | ||
| sudo systemctl start condor || true | ||
| sudo systemctl enable condor || true | ||
|
|
||
| - name: Install Pegasus | ||
| shell: bash | ||
| run: | | ||
| wget -qO - https://download.pegasus.isi.edu/pegasus/gpg.txt | sudo apt-key add - | ||
| echo "deb https://download.pegasus.isi.edu/pegasus/ubuntu noble main" | sudo tee -a /etc/apt/sources.list | ||
| sudo apt-get -o Acquire::Retries=3 update | ||
| sudo apt-get -o Acquire::Retries=3 install -y pegasus=5.1.1-1+ubuntu24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Install system packages | ||
| description: "Composite action to install common system packages (fftw3, intel-mkl, mpi, graphviz) on Ubuntu runners." | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Update apt | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get -o Acquire::Retries=3 update | ||
|
|
||
| - name: Install system packages | ||
| shell: bash | ||
| run: | | ||
| set -euxo pipefail | ||
| sudo apt-get -o Acquire::Retries=3 install -y *fftw3* intel-mkl* mpi graphviz | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Populate caches (LAL aux + example GW data) | ||
| description: "Composite action that restores LAL auxiliary data and example GW data caches and downloads missing files." | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Restore LAL auxiliary data cache | ||
| id: restore-lal-aux | ||
| uses: actions/cache@v4 | ||
| with: | ||
| key: lal-aux-data | ||
| path: $HOME/lal_aux_data | ||
|
|
||
| - name: Download LAL auxiliary data files on miss | ||
| if: ${{ steps.restore-lal-aux.outputs.cache-hit != 'true' }} | ||
| run: | | ||
| mkdir -p $HOME/lal_aux_data | ||
| pushd $HOME/lal_aux_data | ||
| curl --show-error --silent --fail --retry 3 --retry-delay 5 --retry-connrefused \ | ||
| --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: Restore example GW data cache | ||
| name: Populate caches (LAL aux + example GW data) | ||
| description: "Composite action that restores LAL auxiliary data and example GW data caches and downloads missing files." | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Restore LAL auxiliary data cache | ||
| id: restore-lal-aux | ||
| uses: actions/cache@v4 | ||
| with: | ||
| key: lal-aux-data | ||
| path: $HOME/lal_aux_data | ||
|
|
||
| - name: Download LAL auxiliary data files on miss | ||
| if: ${{ steps.restore-lal-aux.outputs.cache-hit != 'true' }} | ||
| run: | | ||
| mkdir -p $HOME/lal_aux_data | ||
| pushd $HOME/lal_aux_data | ||
| curl --show-error --silent --fail --retry 3 --retry-delay 5 --retry-connrefused \ | ||
| --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: Restore example GW data cache | ||
| id: restore-example-gw | ||
| 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 | ||
| examples/search/*.gwf | ||
|
|
||
| - name: Set path outputs for cached data | ||
| id: set_paths | ||
| run: | | ||
| echo "lal_data_path=$HOME/lal_aux_data" >> $GITHUB_OUTPUT | ||
| echo "example_gw_cache_key=example-gw-data" >> $GITHUB_OUTPUT | ||
|
|
||
| outputs: | ||
| lal_data_path: | ||
| description: "Path where LAL auxiliary data is stored on the runner" | ||
| value: ${{ steps.set_paths.outputs.lal_data_path }} | ||
| example_gw_cache_key: | ||
| description: "Cache key used for example GW data" | ||
| value: ${{ steps.set_paths.outputs.example_gw_cache_key }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,67 +13,37 @@ jobs: | |
| max-parallel: 60 | ||
| matrix: | ||
| os: [ubuntu-24.04] | ||
| python-version: ['3.11', '3.12', '3.13'] | ||
| python_version: ['3.11', '3.12', '3.13'] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| test-type: [unittest, search, docs] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| - name: Populate caches (LAL aux + example GW data) | ||
| id: populate | ||
| uses: ./.github/actions/populate-caches | ||
| - name: Expose LAL_DATA_PATH to subsequent steps | ||
| run: echo "LAL_DATA_PATH=${{ steps.populate.outputs.lal_data_path }}" >> $GITHUB_ENV | ||
| - name: Set up Python ${{ matrix.python_version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| python-version: ${{ matrix.python_version }} | ||
| - name: installing system packages | ||
| uses: .github/actions/install-system-deps | ||
| - name: Install python dependencies | ||
| run: | | ||
| 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 | ||
GarethCabournDavies marked this conversation as resolved.
Show resolved
Hide 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' | ||
| if: matrix.test-type == 'docs' && matrix.python_version == '3.12' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: documentation-page | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?