Skip to content

fix conda cache

fix conda cache #960

Workflow file for this run

name: Python package
on: [push, pull_request]
jobs:
setup_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
test: ["test_config_generation"]
test-case: ["atac", "chip-rx", "chip", "rna-rx", "rna", "snp"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache conda environment
id: cache-conda
uses: actions/cache@v3
with:
path: |
~/miniforge3/envs/test
~/.cache/pip
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('**/testing.yml') }}
restore-keys: |
${{ runner.os }}-conda-${{ matrix.python-version }}-
- name: Setup environment
if: steps.cache-conda.outputs.cache-hit != 'true'
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-activate-base: true
channel-priority: strict
channels: conda-forge, bioconda, defaults
conda-solver: mamba
environment-file: testing.yml
environment-name: test
mamba-version: latest
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- name: Update environment
if: steps.cache-conda.outputs.cache-hit != 'true'
run: mamba env update -n test -f testing.yml
- name: list conda envs
run: |
conda env list
env_path="/home/runner/miniconda3/envs/test"
if [ -d "$env_path" ]; then
echo "Environment exists"
else
echo "Environment does not exist"
fi
shell: bash -l {0}
- name: Install package
if: steps.cache-conda.outputs.cache-hit != 'true'
run: |
source /home/runner/miniforge3/bin/activate test
pip install .
shell: bash -l {0}
# - name: Verify and activate environment
# run: |
# source ~/miniforge3/bin/activate test
# which seqnado
# shell: bash -l {0}
# - name: Run test
# run: |
# source ~/miniforge3/bin/activate test
# pytest "tests/test_pipelines.py::${{ matrix.test }}[${{ matrix.test-case }}]" -vv -s --cores 4 -k
# shell: bash -l {0}