Skip to content

MergedAnalysis + General Updates #206

MergedAnalysis + General Updates

MergedAnalysis + General Updates #206

name: Install and Testing with Conda
on:
pull_request:
types: [synchronize, opened, reopened]
branches:
- main
concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
testing:
name: Test on ${{ matrix.os }} OS
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/test_env
- os: macos-latest
label: osx-64
prefix: /Users/runner/miniconda3/envs/test_env
- os: windows-latest
label: win-64
prefix: C:\Miniconda3\envs\test_env
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: conda-incubator/setup-miniconda@v2.2.0
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
activate-environment: test_env
- name: Set cache date
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV
shell: bash
- uses: actions/cache@v3
id: cache
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('**/pyproject.toml') }}-${{ env.DATE }}
- if: ${{steps.cache.outputs.cache-hit != 'true'}}
name: Update environment
run: mamba env update -n test_env -f test_env.yml
- name: Install package
run: |
pip install git+https://github.com/NeuralEnsemble/python-neo.git
pip install git+https://github.com/zm711/spikeanalysis.git
- name: Test with pytest
run: |
pytest --cov-config=pyproject.toml --cov=spikeanalysis