[pre-commit.ci] pre-commit autoupdate #124
This file contains 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
name: Test | |
on: | |
push: | |
branches: | |
- main | |
- 'release**' | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
branches: | |
- main | |
- 'release**' | |
paths-ignore: | |
- 'docs/**' | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
miniconda: | |
name: Miniconda ${{ matrix.os }}-${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.7', '3.8', '3.9', '3.10'] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: conda-incubator/setup-miniconda@v2 | |
name: Set up conda | |
with: | |
activate-environment: test_env | |
environment-file: build_tools/test_env.yml | |
miniconda-version: "latest" | |
auto-update-conda: true | |
channels: conda-forge,defaults | |
channel-priority: true | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
use-only-tar-bz2: true | |
- name: Check Conda Setup | |
shell: bash -l {0} | |
run: | | |
conda --version | |
conda info --envs | |
which python | |
- name: Run Safety security check | |
shell: bash -l {0} | |
# This will scan the installed python environment for all installed dependencies | |
# including transitive dependencies | |
# Ignoring CVEs disputed by NumPy devs with IDs 44715, 44716, 44717 | |
run: safety check --full-report -i 44715 -i 44716 -i 44717 | |
# Do not continue on error. Fail the action if safety returns a | |
# non-zero exit code indicating a vulnerability has been found | |
continue-on-error: false | |
- name: Generate Pytest coverage report | |
shell: bash -l {0} | |
run: | | |
conda activate test_env | |
pytest --cov=./ --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
flags: unittests | |
verbose: true |