diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6fa98cd..12ce718 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,7 +5,24 @@ on: - pull_request jobs: - ci: - uses: nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml@dec0880059017dac7facf100435c5737bf1386c8 + pathogen-ci: + strategy: + matrix: + runtime: [docker, conda] + permissions: + id-token: write + uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master + secrets: inherit with: - workflow-root: phylogenetic + runtime: ${{ matrix.runtime }} + run: | + nextstrain build \ + phylogenetic \ + --configfile profiles/ci/profiles_config.yaml + artifact-name: output-${{ matrix.runtime }} + artifact-paths: | + phylogenetic/auspice/ + phylogenetic/results/ + phylogenetic/benchmarks/ + phylogenetic/logs/ + phylogenetic/.snakemake/log/ \ No newline at end of file diff --git a/phylogenetic/Snakefile b/phylogenetic/Snakefile index d599360..30c4777 100644 --- a/phylogenetic/Snakefile +++ b/phylogenetic/Snakefile @@ -1,5 +1,4 @@ -if not config: - configfile: "config/config_zika.yaml" +configfile: "config/config_zika.yaml" rule all: input: @@ -22,6 +21,12 @@ include: "rules/construct_phylogeny.smk" include: "rules/annotate_phylogeny.smk" include: "rules/export.smk" +# Include custom rules defined in the config. +if "custom_rules" in config: + for rule_file in config["custom_rules"]: + + include: rule_file + rule clean: """Removing directories: {params}""" params: diff --git a/phylogenetic/profiles/ci/copy_example_data.smk b/phylogenetic/profiles/ci/copy_example_data.smk new file mode 100644 index 0000000..495d778 --- /dev/null +++ b/phylogenetic/profiles/ci/copy_example_data.smk @@ -0,0 +1,21 @@ +rule copy_example_data: + input: + sequences="example_data/sequences.fasta", + metadata="example_data/metadata.tsv", + usvi_sequences="example_data/sequences_usvi.fasta", + usvi_metadata="example_data/metadata_usvi.tsv", + output: + sequences="data/sequences.fasta", + metadata="data/metadata.tsv", + usvi_sequences="data/sequences_usvi.fasta", + usvi_metadata="data/metadata_usvi.tsv", + shell: + """ + cp -f {input.sequences} {output.sequences} + cp -f {input.metadata} {output.metadata} + cp -f {input.usvi_sequences} {output.usvi_sequences} + cp -f {input.usvi_metadata} {output.usvi_metadata} + """ + +ruleorder: copy_example_data > decompress +ruleorder: copy_example_data > decompress_usvi \ No newline at end of file diff --git a/phylogenetic/profiles/ci/profiles_config.yaml b/phylogenetic/profiles/ci/profiles_config.yaml new file mode 100644 index 0000000..17bad21 --- /dev/null +++ b/phylogenetic/profiles/ci/profiles_config.yaml @@ -0,0 +1,2 @@ +custom_rules: + - profiles/ci/copy_example_data.smk