Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

51 changes: 41 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,48 @@ inputs:
required: false
default: 'run'
show-disk-usage-on-error:
descriptions: Whether to return the used disk space on failing.
description: Whether to return the used disk space on failing.
required: false
default: false
snakemake-version:
description: Snakemake version to use. If not specified, uses latest version. Pin a specific version (e.g., '8.25.5') for reproducibility.
required: false

runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.directory }}
- ${{ inputs.snakefile }}
- ${{ inputs.args }}
- ${{ inputs.stagein }}
- ${{ inputs.task }}
- ${{ inputs.show-disk-usage-on-error }}
using: 'composite'
steps:
- name: Validate inputs
if: ${{ ! (inputs.task == 'containerize' || inputs.task == 'run' )}}
shell: bash -el {0}
run: |
echo 'Invalid value for "task": "${{ inputs.task }}". Options: "containerize", "run".'
exit 1
- shell: bash -el {0}
run: sed 's/{{ snakemake_version }}/${{ inputs.snakemake-version }}/g' environment.yaml.template > environment.yaml
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda
channel-priority: strict
miniforge-version: latest
environment-file: environment.yaml
activate-environment: snakemake
- name: Run snakemake
if: ${{ inputs.task == 'run' }}
shell: bash -el {0}
run: |
snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }}
if [[ "$?" -ne 0 ]]; then
if [[ ${{ inputs.show-disk-usage-on-error }} = true ]]; then
# return disk usage and space on failing
df -h
printf "disk usage working directory"
du -h -d3 ${{ inputs.directory }}
fi
exit 1
fi
- name: Containerize snakemake
if: ${{ inputs.task == 'containerize' }}
shell: bash -el {0}
run: snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }} --containerize > Dockerfile

25 changes: 0 additions & 25 deletions entrypoint.sh

This file was deleted.

6 changes: 6 additions & 0 deletions environment.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
- nodefaults
dependencies:
- snakemake =={{ snakemake_version }}
Loading