Skip to content

Commit

Permalink
switch tests to build in conda env
Browse files Browse the repository at this point in the history
  • Loading branch information
lrauschning committed Dec 12, 2024
1 parent 0acfba4 commit c310df8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 34 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,32 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build msyd
uses: schneebergerlab/msyd@main
# use old install manually
# since switching to conda no longer supports different python version
# - name: Build msyd
# uses: schneebergerlab/msyd@main
# # with:
# # python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ inputs.python-version }}
cache: pip
- name: Update pip
run: python -m pip install --upgrade pip setuptools
shell: bash
- name: Install SyRI manually
run: |
# manually install syris dependencies
# the python version spoofing requires the --no-deps flag, so this is necessary
pip install Cython numpy pandas scipy psutil igraph longestrunsubsequence pysam pulp
# manually use pip to install syri from github, as it isn't on pypi
# spoof python version to get around bounds check
pip install 'git+https://github.com/schneebergerlab/syri.git' --python-version '3.10' --no-deps --no-warn-conflicts --target $(python -m site --user-site)
shell: bash
- name: Install other dependencies
run: pip install -r requirements.txt
shell: bash
- name: Test installation
run: |
msyd --version
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
steps:
- name: Build msyd
uses: schneebergerlab/msyd@main
with:
python-version: "3.12"
- name: Install minimap2 manually # conda doesn't seem to work
run: |
curl -L https://github.com/lh3/minimap2/releases/download/v2.28/minimap2-2.28_x64-linux.tar.bz2 | tar -jxvf -
mv minimap2-2.28_x64-linux\/minimap2 ./
./minimap2 -h # test it worked & is callable
# with:
# python-version: "3.12"
# - name: Install minimap2 manually # conda doesn't seem to work
# run: |
# curl -L https://github.com/lh3/minimap2/releases/download/v2.28/minimap2-2.28_x64-linux.tar.bz2 | tar -jxvf -
# mv minimap2-2.28_x64-linux\/minimap2 ./
# ./minimap2 -h # test it worked & is callable
- name: Test example_run.sh
run: ./.github/workflows/run_test_example.sh
shell: bash
53 changes: 29 additions & 24 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,42 @@
name: Build msyd
description: "Checks out, installs dependencies and builds the msyd package. Formulated as a composite action to reduce code duplication in testing. Composite workflows cannot perserve state."

inputs:
python-version:
description: 'Python version to use'
required: true
default: '3.12'
#inputs:
# python-version:
# description: 'Python version to use'
# required: true
# default: '3.12'

runs:
using: composite
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: pip
- name: Update pip
run: python -m pip install --upgrade pip setuptools
shell: bash
- name: Install SyRI manually
# - name: Set up Python ${{ inputs.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ inputs.python-version }}
# cache: pip
# - name: Update pip
# run: python -m pip install --upgrade pip setuptools
# shell: bash
# - name: Install SyRI manually
# run: |
# # manually install syris dependencies
# # the python version spoofing requires the --no-deps flag, so this is necessary
# pip install Cython numpy pandas scipy psutil igraph longestrunsubsequence pysam pulp
# # manually use pip to install syri from github, as it isn't on pypi
# # spoof python version to get around bounds check
# pip install 'git+https://github.com/schneebergerlab/syri.git' --python-version '3.10' --no-deps --no-warn-conflicts --target $(python -m site --user-site)
# shell: bash
# - name: Install other dependencies
# run: pip install -r requirements.txt
# shell: bash
- name: Setup conda env
run: |
# manually install syris dependencies
# the python version spoofing requires the --no-deps flag, so this is necessary
pip install Cython numpy pandas scipy psutil igraph longestrunsubsequence pysam pulp
# manually use pip to install syri from github, as it isn't on pypi
# spoof python version to get around bounds check
pip install 'git+https://github.com/schneebergerlab/syri.git' --python-version '3.10' --no-deps --no-warn-conflicts --target $(python -m site --user-site)
shell: bash
- name: Install other dependencies
run: pip install -r requirements.txt
shell: bash
$CONDA/bin/conda env create -n msyd --file ./environment.yml
$CONDA/bin/conda activate msyd
# python -m pip install mappy
- name: Build msyd
run: pip install .
shell: bash

0 comments on commit c310df8

Please sign in to comment.