Skip to content

Update .readthedocs.yml build config #483

Update .readthedocs.yml build config

Update .readthedocs.yml build config #483

Workflow file for this run

name: test
on: [pull_request] #, push]
jobs:
# Runs the tests on combinations of the supported python/os matrix.
test-code:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9']
fail-fast: false
# continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Get conda env file
shell: bash -l {0}
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
cp .github/test_conda_env_macOS.yml .github/test_conda_env.yml
fi
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if needed by env file has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('.github/test_conda_env.yml') }}
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
use-only-tar-bz2: true # Must be set for caching to work properly
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e .
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
# - name: run all tests
# shell: bash -l {0}
# run: |
# py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
# export OMP_NUM_THREADS=2
# py.test -m "serial and not network" --cov-report=xml --cov-append
# py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: run main test suite
shell: bash -l {0}
run: |
py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml --dist loadscope
- name: run serial test
if: always()
shell: bash -l {0}
run: |
export OMP_NUM_THREADS=2
py.test -m "serial and not network" --cov-report=xml --cov-append
- name: run slow tests
if: always()
shell: bash -l {0}
run: |
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
test-code-slow:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if needed by env file has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('.github/test_conda_env.yml') }}
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
use-only-tar-bz2: true # Must be set for caching to work properly
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e .
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: run network tests
shell: bash -l {0}
run: |
py.test -n 2 -m "network" --cov-report=xml
- name: run tutorials
if: always()
shell: bash -l {0}
run: |
py.test eqcorrscan/doc/tutorials/*.rst eqcorrscan/doc/submodules/*.rst --cov-report=xml --cov-append
- name: run superslow tests
if: always()
shell: bash -l {0}
run: |
py.test -m "superslow" -s eqcorrscan/tests/tutorials_test.py eqcorrscan/tests/subspace_test.py --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
test-code-fmf:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if needed by env file has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('.github/test_conda_env.yml') }}
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
environment-file: .github/test_conda_env.yml
condarc-file: .github/test_condarc.yml
use-only-tar-bz2: true # Must be set for caching to work properly
- name: install fmf
shell: bash -l {0}
run: |
cd ..
git clone https://github.com/beridel/fast_matched_filter.git
cd fast_matched_filter
pip install -e .
cd ../EQcorrscan
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e .
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: run correlation test
shell: bash -l {0}
run: |
export OMP_NUM_THREADS=2
py.test eqcorrscan/tests/correlate_test.py --cov-report=xml
- name: upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
# This is a very useful step for debugging, it allows you to ssh into the CI
# machine (https://github.com/marketplace/actions/debugging-with-tmate).
# Make sure to open the log before the job starts else you cant see the tmate
# url. See https://github.com/mxschmitt/action-tmate/issues/1.
# Also, the CI machine will close on a non-zero exit code (annoying). This can
# be overcome by coalescing the null command like so:
# $ some-command-that-can-fail || :
#
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v1