diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 31b722e1..c5fb53bf 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -14,32 +14,32 @@ jobs: uses: actions/setup-python@v3 with: python-version: '3.6.15' - - name: Add conda to system path + - name: Install micromamba run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH + bash <(curl -L micro.mamba.pm/install.sh) + export MAMBA_EXE='/home/runner/.local/bin/micromamba' + export MAMBA_ROOT_PREFIX='/home/runner/micromamba' - name: Install dependencies run: | export LANG=en_US.iso885915 - conda info echo $LANG - conda env update --file environment.yml --name base + micromamba create --file environment.yml - name: Install microSALT run: | - mkdir ~/.microSALT && cp configExample.json ~/.microSALT/config.json - GITHUB_BRANCH=${GITHUB_REF##*/} - branch=$GITHUB_BRANCH; yes | bash <(cat install.sh) $branch - conda activate microSALT - - name: Lint with flake8 - run: | - conda install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + micromamba activate microSALT + mkdir ~/.microSALT && cp configExample.json ~/.microSALT/config.json + GITHUB_BRANCH=${GITHUB_REF##*/} + pip install -r requirements.txt -r requirements-dev.txt + pip install -U . + #- name: Lint with flake8 + # run: | + # #micromamba install flake8 + # # stop the build if there are Python syntax errors or undefined names + # #flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + # #flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - conda install pytest pytest --cov=microSALT tests/ - name: Run Coveralls run: | diff --git a/environment.yml b/environment.yml index 3ac3f1aa..b3da0c9e 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ -name: P_microSALT +name: microSALT channels: - conda-forge - bioconda @@ -8,11 +8,12 @@ dependencies: - blast=2.12.0 - bwa=0.7.17 - picard=2.20.3 - - pigz=2.4 + - pigz>=2.4 - quast=5.0.2 - samtools=1.13 - spades=3.13.1 - trimmomatic=0.39 - r-base=4.1.1 - openjdk=11.0.9.1 - + - pytest=6.2.5 + - pytest-cov=2.12.1 diff --git a/install.sh b/install.sh index ec14f416..1a9dc4a7 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e +set -x shopt -s nullglob #Suggests provided branch. Else suggests master @@ -52,11 +53,11 @@ done echo "Thank you, setting up environment $cname!" #Unload environment -conda info | tac | tac | grep -q $cname && source deactivate || : +micromamba info | tac | tac | grep -q $cname && source deactivate || : #Remove environment if already present -conda remove -y -n $cname --all || : +micromamba remove -y -n $cname --all || : -conda env create -n $cname -f https://raw.githubusercontent.com/Clinical-Genomics/microSALT/$branch/environment.yml +micromamba env create -y -f <(curl -L https://raw.githubusercontent.com/Clinical-Genomics/microSALT/$branch/environment.yml ) source activate $cname if [[ $type == "release" ]]; then