@@ -27,17 +27,44 @@ inputs:
2727 required : false
2828 default : ' run'
2929 show-disk-usage-on-error :
30- descriptions : Whether to return the used disk space on failing.
30+ description : Whether to return the used disk space on failing.
3131 required : false
3232 default : false
33+ snakemake-version :
34+ description : Which snakemake version to use
35+ required : false
36+ default : 8.25.5
3337
3438runs :
35- using : ' docker'
36- image : ' Dockerfile'
37- args :
38- - ${{ inputs.directory }}
39- - ${{ inputs.snakefile }}
40- - ${{ inputs.args }}
41- - ${{ inputs.stagein }}
42- - ${{ inputs.task }}
43- - ${{ inputs.show-disk-usage-on-error }}
39+ using : ' composite'
40+ steps :
41+ - shell : bash -el {0}
42+ run : sed 's/{{ snakemake_version }}/${{ inputs.snakemake-version }}/g' environment.yaml.template > environment.yaml
43+ - name : Setup conda
44+ uses : conda-incubator/setup-miniconda@v3
45+ with :
46+ channels : conda-forge,bioconda
47+ channel-priority : strict
48+ miniforge-version : latest
49+ environment-file : environment.yaml
50+ - name : Run snakemake
51+ if : ${{ inputs.task == 'run' }}
52+ shell : bash -el {0}
53+ run : |
54+ snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }}
55+ if [[ "$?" -ne 0 ]]; then
56+ if [[ "$6" = true ]]; then
57+ # return disk usage and space on failing
58+ df -h
59+ printf "disk usage working directory"
60+ du -h -d3 $1
61+ fi
62+ exit 1
63+ fi
64+ - name : Containerize snakemake
65+ if : ${{ inputs.task == 'containerize' }}
66+ shell : bash -el {0}
67+ run : snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }} --containerize > Dockerfile
68+ - if : ${{ ! (inputs.task == 'containerize' || inputs.task == 'run' )}}
69+ run : echo "Invalid value for 'task': '${{ inputs.task }}'. Options: 'containerize', 'run'." && exit 1
70+
0 commit comments