Skip to content

Deactivate run shell to fix cleanup error in micromamba #718

Deactivate run shell to fix cleanup error in micromamba

Deactivate run shell to fix cleanup error in micromamba #718

Workflow file for this run

name: Test pysteps
on:
# Triggers the workflow on push or pull request events to the master branch
push:
branches:
- master
- pysteps-v2
pull_request:
branches:
- master
- pysteps-v2
jobs:
unit_tests:
name: Unit Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: ["3.8", "3.10"]
max-parallel: 6
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install mamba and create environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/ci_test_env.yml
environment-name: test_environment
generate-run-shell: false
create-args: python=${{ matrix.python-version }}
- name: Install pygrib (not win)
if: matrix.os != 'windows-latest'
run: mamba install --quiet pygrib
- name: Install pysteps for MacOS
if: matrix.os == 'macos-latest'
working-directory: ${{github.workspace}}
env:
CC: gcc-9
CXX: g++-9
CXX1X: g++-9
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew update-reset
brew update
gcc-9 --version || brew install gcc@9
pip install .
- name: Install pysteps
if: matrix.os != 'macos-latest'
working-directory: ${{github.workspace}}
run: pip install .
- name: Download pysteps data
env:
PYSTEPS_DATA_PATH: ${{github.workspace}}/pysteps_data
working-directory: ${{github.workspace}}/ci
run: python fetch_pysteps_data.py
- name: Check imports
working-directory: ${{github.workspace}}/pysteps_data
run: |
python --version
python -c "import pysteps; print(pysteps.__file__)"
python -c "from pysteps import motion"
python -c "from pysteps.motion import vet"
python -c "from pysteps.motion import proesmans"
- name: Run tests and coverage report
working-directory: ${{github.workspace}}/pysteps_data
env:
PYSTEPSRC: ${{github.workspace}}/pysteps_data/pystepsrc
run: pytest --pyargs pysteps --cov=pysteps --cov-report=xml --cov-report=term -ra
- name: Upload coverage to Codecov (Linux only)
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{github.workspace}}/pysteps_data/coverage.xml
flags: unit_tests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true