Skip to content

[Snyk] Fix for 4 vulnerabilities #564

[Snyk] Fix for 4 vulnerabilities

[Snyk] Fix for 4 vulnerabilities #564

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.8', '3.9', '3.10', '3.11']
fail-fast: false
# continue-on-error: true
steps:
- uses: actions/checkout@v3
- 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: Setup conda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
use-mamba: true
- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -v -e . --no-deps
- 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 and not slow" --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@v3
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.10']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
use-mamba: true
- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e . --no-deps
- 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 and not superslow" --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@v3
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.9']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
use-mamba: true
- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml
- 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 . --no-deps
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@v3
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