Skip to content

fix simulate_samples #107

fix simulate_samples

fix simulate_samples #107

Workflow file for this run

name: Python test on Mamba
on:
push:
branches:
- main
- 'releases/**'
jobs:
create-env:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: create environment with mamba
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,bioconda,defaults
auto-activate-base: false
activate-environment: fununifrac
environment-file: environment.yml
- name: check env
run: |
mamba env export
- name: pytest
run: |
cd ./tests
pytest .
# I have tried below setup but failed with it because it basically does not activate any environment.
# It is not a problem until we use subprocess.run in the test. Then subprocess try to use conda environment, which is not activated,
# resulting in ModuleNotFoundError for any pip modules.
# jobs:
# build:
# runs-on: [ubuntu-latest]
# defaults:
# run:
# shell: bash -l {0}
# strategy:
# matrix:
# python-version: ["3.9"]
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# $CONDA/bin/conda env update --file environment.yml --name base
# - name: Lint with flake8
# run: |
# $CONDA/bin/conda install flake8
# # stop the build if there are Python syntax errors or undefined names
# $CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# $CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# cd ./tests
# $CONDA/bin/pytest .