diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9252f756..12ce7187 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 \ No newline at end of file + 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 a2ced232..9b8f998f 100644 --- a/phylogenetic/Snakefile +++ b/phylogenetic/Snakefile @@ -1,5 +1,4 @@ -if not config: - configfile: "config/config_dengue.yaml" +configfile: "config/config_dengue.yaml" serotypes = ['all', 'denv1', 'denv2', 'denv3', 'denv4'] @@ -12,6 +11,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 00000000..4f11a7cd --- /dev/null +++ b/phylogenetic/profiles/ci/copy_example_data.smk @@ -0,0 +1,14 @@ +rule copy_example_data: + input: + sequences="example_data/sequences_{serotype}.fasta", + metadata="example_data/metadata_{serotype}.tsv", + output: + sequences="data/sequences_{serotype}.fasta", + metadata="data/metadata_{serotype}.tsv", + shell: + """ + cp -f {input.sequences} {output.sequences} + cp -f {input.metadata} {output.metadata} + """ + +ruleorder: copy_example_data > decompress \ 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 00000000..17bad213 --- /dev/null +++ b/phylogenetic/profiles/ci/profiles_config.yaml @@ -0,0 +1,2 @@ +custom_rules: + - profiles/ci/copy_example_data.smk