diff --git a/.github/workflows/python-app.yaml b/.github/workflows/python-app.yaml index a69de11fd..a62d71a03 100644 --- a/.github/workflows/python-app.yaml +++ b/.github/workflows/python-app.yaml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies and run tests -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Python application on: @@ -12,7 +9,12 @@ on: jobs: build: - runs-on: ubuntu-latest + # we find that CPU/memory limits are less often exceeded using this + # specific version of Ubuntu + runs-on: ubuntu-20.04 + + #runs-on: ubuntu-latest + steps: - uses: actions/checkout@v2 @@ -20,23 +22,31 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.9 - - name: pip installation test + + - name: pip installation + # test pip installation first (much faster than conda) run: | pip install --upgrade pip pip install -e . - - name: Basic checks + - name: Basic tests run: | python tests/check_import.py python tests/check_entry_points.py bash tests/check_examples.bash - - name: Integration tests + - name: Advanced tests run: | bash data/examples/unpack.bash bash data/tests/unpack.bash python tests/benchmark_cap_vs_mtuq.py --no_figures python tests/test_grid_search_mt.py --no_figures python tests/test_grid_search_mt_depth.py --no_figures -# - name: Conda installation tests -# run: | -# bash tests/conda_install.bash + + # unfortunately, these Conda installation tests exceed the resource limits + # for GitHub workflows + # (https://github.com/actions/runner-images/issues/6680) + # (https://github.com/conda/conda/issues/8650) + #- name: conda installation + # timeout-minutes: 60 + # run: | + # bash tests/conda_install.bash diff --git a/env.yaml b/env.yaml index 79aff29a0..9c7d2e1e9 100644 --- a/env.yaml +++ b/env.yaml @@ -1,5 +1,6 @@ dependencies: - conda-build + - python=3 - numpy - scipy - obspy diff --git a/tests/conda_install.bash b/tests/conda_install.bash index fab75c952..976d68d40 100755 --- a/tests/conda_install.bash +++ b/tests/conda_install.bash @@ -17,7 +17,6 @@ MTUQ_PATH=$(dirname ${BASH_SOURCE[0]})/.. # mtuq/docs/install/env_conda.rst # PYTHON_VERSION=3 -DEPENDENCIES="conda-build numpy scipy obspy instaseis pandas xarray netCDF4 h5py mpi4py retry" # @@ -89,15 +88,15 @@ conda_update $CONDA_PATH >> tests/log1 echo SUCCESS echo -echo "Testing mtuq installation without PyGMT" -conda env create -q --name env_step2 python=$PYTHON_VERSION --file env.yaml > tests/log2 +echo "Testing mtuq installation" +conda env create -q --name env_step2 --file env.yaml > tests/log2 conda activate env_step2 conda deactivate echo SUCCESS echo echo "Testing mtuq installation with PyGMT" -conda env create -q --name env_step3 python=$PYTHON_VERSION --file env.yaml > tests/log3 +conda env create -q --name env_step3 --file env.yaml > tests/log3 conda activate env_step3 conda install pygmt >> tests/log3 conda deactivate