Skip to content

Commit

Permalink
WIP: Try to get GHA workflow to work
Browse files Browse the repository at this point in the history
WIP: Try to get GHA workflow to work
  • Loading branch information
samuell committed Jun 28, 2024
1 parent f30b4c5 commit a431e1d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 4 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: P_microSALT
name: microSALT
channels:
- conda-forge
- bioconda
Expand All @@ -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
7 changes: 4 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

set -e
set -x
shopt -s nullglob

#Suggests provided branch. Else suggests master
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a431e1d

Please sign in to comment.