Skip to content
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
cd4b672
Setup environment in github actions
PussInDasBoot May 1, 2025
a0388cf
Add MPI and hdf5 dependencies to linux script
PussInDasBoot May 15, 2025
96092c2
Move linux dependencies to workflow script
PussInDasBoot May 15, 2025
71371bf
crypt
PussInDasBoot May 15, 2025
546fff7
Install requirements.txt
PussInDasBoot Jun 11, 2025
44752d5
Cache dependencies
PussInDasBoot Jun 11, 2025
7e40f93
Python pip install requirements
PussInDasBoot Jun 11, 2025
dbeb1d9
Change path for cache
PussInDasBoot Jun 11, 2025
7462583
Use ~ as cache path
PussInDasBoot Jun 11, 2025
0b431d7
Use main checkout
PussInDasBoot Jun 11, 2025
149702c
Use home cache conda path
PussInDasBoot Jun 11, 2025
9c18618
Remove coverage
PussInDasBoot Jun 11, 2025
b77df7f
shell bash el pytest
PussInDasBoot Jun 11, 2025
c103220
Cobertura
PussInDasBoot Jun 11, 2025
0c7ba77
Always save cache
PussInDasBoot Jun 11, 2025
8c4fb74
Install requirements before test
PussInDasBoot Jun 11, 2025
26060a3
Use restore action
PussInDasBoot Jun 11, 2025
b45cb86
Activate conda env in pytest
PussInDasBoot Jun 11, 2025
44e2b8c
Change cach paths
PussInDasBoot Jun 11, 2025
5807f61
Conda init
PussInDasBoot Jun 11, 2025
9f38347
Add anaconda3 path
PussInDasBoot Jun 11, 2025
0f9da23
Eval conda shell
PussInDasBoot Jun 11, 2025
b78c492
Save cache after conda install
PussInDasBoot Jun 11, 2025
5381c58
Check paths
PussInDasBoot Jun 11, 2025
02c21ed
C:/Program Files/Git/home/runner path
PussInDasBoot Jun 11, 2025
3287e7e
Anaconda 3 dir
PussInDasBoot Jun 11, 2025
56292d9
Don't restore cache
PussInDasBoot Jun 11, 2025
29c3665
Remove coveragerc
PussInDasBoot Jun 11, 2025
6b171ff
Install submodules
PussInDasBoot Jun 11, 2025
3fdae6b
Remove caching
PussInDasBoot Jun 11, 2025
9516161
back to Anaconda 3 dir
PussInDasBoot Jun 11, 2025
be193fd
Conda info envs
PussInDasBoot Jun 11, 2025
3b8d7fb
Run even if cache
PussInDasBoot Jun 11, 2025
909bcda
Remove caching
PussInDasBoot Jun 11, 2025
18d1325
ls miniconda envs
PussInDasBoot Jun 11, 2025
40202ac
Cache home/runner/anaconda3 and /usr/share/miniconda
PussInDasBoot Jun 11, 2025
2780f59
Submodules
PussInDasBoot Jun 11, 2025
a497611
Install pyyaml
PussInDasBoot Jun 11, 2025
74d191c
cache all of home/runner
PussInDasBoot Jun 11, 2025
5cff84f
pip list
PussInDasBoot Jun 11, 2025
2a7a53d
Remove cache
PussInDasBoot Jun 11, 2025
2a030e1
activate conda env in pytest
PussInDasBoot Jun 11, 2025
2bbeb25
Re-add caching
PussInDasBoot Jun 11, 2025
807b95f
Don't restore
PussInDasBoot Jun 11, 2025
f650ae0
Find where mpi is installed
PussInDasBoot Jun 11, 2025
28abed2
Don't restore
PussInDasBoot Jun 11, 2025
baefebc
Cache /home /usr and /etc
PussInDasBoot Jun 11, 2025
b357c4c
Restore dependencies
PussInDasBoot Jun 11, 2025
6405d26
Install ubuntu packages twice
PussInDasBoot Jun 11, 2025
6d79f1a
Install tables in pip
PussInDasBoot Jun 11, 2025
e68e027
Only cache hiperseis and create new cache key
PussInDasBoot Jun 11, 2025
9cafc52
Restore dependencies
PussInDasBoot Jun 11, 2025
8c02d34
Anaconda-2 key
PussInDasBoot Jun 11, 2025
b3d5e85
Anaconda-1
PussInDasBoot Jun 11, 2025
e081648
Anaconda
PussInDasBoot Jun 12, 2025
a3349b4
Anaconda 3
PussInDasBoot Jun 12, 2025
17bfdc6
Skip failing test in github actions
PussInDasBoot Jun 12, 2025
e0f3907
Use codecov instead of coveralls
PussInDasBoot Jun 12, 2025
307fab0
Restore and use cache
PussInDasBoot Jun 12, 2025
2473474
Remove coveragerc
PussInDasBoot Jun 12, 2025
51ab251
Run tests folder
PussInDasBoot Jun 12, 2025
c42e71d
Use cache instead of restore and save
PussInDasBoot Jun 12, 2025
26fd408
Remove travis build
PussInDasBoot Jun 12, 2025
8b6d363
Remove reinstallations of linux packages
PussInDasBoot Jun 12, 2025
4c0e031
Only run one test
PussInDasBoot Jun 12, 2025
24207de
Use cache-apt-packages
PussInDasBoot Jun 12, 2025
1e1ce0e
Run all tests
PussInDasBoot Jun 12, 2025
8bccdb0
Remove shell specification
PussInDasBoot Jun 12, 2025
23b9612
Remove conda environment activation
PussInDasBoot Jun 12, 2025
6b96adf
Update comment
PussInDasBoot Jun 12, 2025
dc35015
Remove tests/requirements.txt
PussInDasBoot Jun 13, 2025
9174465
Remove CPATH
PussInDasBoot Jun 13, 2025
23a51b0
Revert "Remove CPATH"
PussInDasBoot Jun 13, 2025
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
57 changes: 0 additions & 57 deletions .coveragerc

This file was deleted.

68 changes: 33 additions & 35 deletions .github/workflows/hiperseis_main_ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This workflow is setup by Fei Zhang to use Github Actions 202-09-14
# This workflow is setup by Fei Zhang to use Github Actions 2020-09-14
# Updated by Melyn Roberts 2025 June to run tests using Anaconda3-2021.11 and Python and package versions designated in linux startup script

name: hiperseis_main_ci

Expand All @@ -8,45 +9,42 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@main
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
python-version: ${{ matrix.python-version }}
packages: openmpi-bin libopenmpi-dev libhdf5-dev
version: 1.0
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@main
with:
path: |
/home/runner
/usr/share/miniconda/envs/hiperseis
key: anaconda
- name: Setting up environment
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
wget -q https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh -O anaconda.sh
bash anaconda.sh -b -p $HOME/anaconda3 > /dev/null 2>&1
export PATH="$HOME/anaconda3/bin:$PATH"
conda init bash
source ~/.bashrc
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
git submodule update --init --recursive
sudo apt-get install libhdf5-dev
sudo apt-get install libmpich-dev
sudo apt-get install libproj-dev proj-bin
sudo apt-get install libgeos-dev
sudo apt-get install libnetcdf-dev

python -m pip install --upgrade pip

pip install numpy
pip install Cython --install-option="--no-cython-compile"
pip install flake8 pytest
pip install pytest-cov
pip install coveralls
pip install pip-tools
pip-compile --upgrade

if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r tests/requirements.txt
pip list
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
source setup_scripts/conda_env_linux.sh hiperseis
- name: Running pytest
run: |
python -m pytest ./tests

eval "$(conda shell.bash hook)"
conda init
conda activate hiperseis
pip install -r tests/requirements.txt
pytest --cov --cov-report=xml ./tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@main
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ seismic/xcorqc/**/*.pbs
**/junk.*
**/LOG_CODE_DUPES_*.txt
**/LOG_LOCATION_DUPES_*.txt
AU_strict/
tests/AU_strict/
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions setup_scripts/conda_env_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#set -e
#set -o pipefail
eval "$(conda shell.bash hook)"

help()
{
Expand All @@ -18,6 +19,7 @@ fi

echo "==== Create a conda environment with requisite packages ===="
conda create -n $1 -c conda-forge python=3.6.8 gfortran_linux-64==7.5.0 gcc_linux-64==7.5.0 gxx_linux-64==7.5.0 proj4 geos libxcrypt
export CPATH=/opt/conda/include/

echo "==== Activating conda environment ===="
conda activate $1
Expand Down
6 changes: 6 additions & 0 deletions tests/requirements.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add these requirements to conda_env_linux.sh as the final set of pip installs, so we can remove this requirements.txt altogether.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pytest
pytest-cov
coverage
requests_mock
pyyaml
tables
3 changes: 3 additions & 0 deletions tests/test_seismic/xcorqc/test_interval_stack_xcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def inv1(request):
def inv2(request):
return request.param

IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"

@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Test doesn't work in Github Actions.")
def test_interval_stack_xcorr(loccha, inv1, inv2, interval_seconds, window_seconds,
window_overlap, whitening, ensemble_stack):
"""
Expand Down