-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.77 KB
/
Makefile
File metadata and controls
47 lines (36 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
SHELL := /usr/bin/env bash
RUN ?= manifests/examples/sample.yaml
EXTRA ?=
.PHONY: help run status validate validate-manifest test clean clean-cache clean-all
help:
@echo "Targets:"
@echo " run - run the pipeline (set RUN=manifests/<sample>.yaml)"
@echo " status - print cache/log/stage status locations for a manifest"
@echo " validate - run syntax checks"
@echo " validate-manifest - validate a manifest (set RUN=manifests/<sample>.yaml)"
@echo " test - run unit tests"
@echo " clean - remove repo-facing results only"
@echo " clean-cache - remove Linux-side cache/work state for this project"
@echo " clean-all - remove both results and cache"
run:
@test -n "$(RUN)" || (echo "Set RUN=manifests/<sample>.yaml"; exit 1)
@bash run.sh "$(RUN)" $(EXTRA)
status:
@test -n "$(RUN)" || (echo "Set RUN=manifests/<sample>.yaml"; exit 1)
@PYTHONPATH=. python3 -m workflow.core.manifest status --manifest "$(RUN)"
validate:
@python3 -m py_compile workflow/core/*.py workflow/stages/*.py workflow/reporting/*.py tests/*.py
@bash -n run.sh
@echo "Validation checks passed."
validate-manifest:
@test -n "$(RUN)" || (echo "Set RUN=manifests/<sample>.yaml"; exit 1)
@PYTHONPATH=. python3 -m workflow.core.manifest validate --manifest "$(RUN)" --schema manifests/schema/run_manifest.schema.json --output /tmp/genomics_manifest.validate.json
@echo "Manifest is valid."
test:
@python3 -m unittest discover -s tests -p "test_*.py"
clean:
@rm -rf output/results
clean-cache:
@CACHE_ROOT="$$(PYTHONPATH=. python3 -m workflow.core.manifest print-project-cache-root --manifest "$(RUN)")" && rm -rf "$$CACHE_ROOT"
clean-all: clean clean-cache
@find workflow tests -type d -name "__pycache__" -prune -exec rm -rf {} +