Skip to content

Commit

Permalink
Update the CI workflow
Browse files Browse the repository at this point in the history
Following the pathogen-repo-guide and
nextstrain/zika@efe11e3
  • Loading branch information
kimandrews committed Feb 23, 2024
1 parent 88f2e68 commit 15bebcb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,24 @@ on:
- pull_request

jobs:
ci:
uses: nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml@master
pathogen-ci:
strategy:
matrix:
runtime: [docker, conda]
permissions:
id-token: write
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master
secrets: inherit
with:
runtime: ${{ matrix.runtime }}
run: |
nextstrain build \
phylogenetic \
--configfile build-configs/ci/config.yaml
artifact-name: output-${{ matrix.runtime }}
artifact-paths: |
phylogenetic/auspice/
phylogenetic/results/
phylogenetic/benchmarks/
phylogenetic/logs/
phylogenetic/.snakemake/log/
6 changes: 6 additions & 0 deletions phylogenetic/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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:
Expand Down
7 changes: 7 additions & 0 deletions phylogenetic/build-configs/ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This configuration file contains the custom configurations parameters
# for the CI workflow to run with the example data.

# Custom rules to run as part of the CI automated workflow
# The paths should be relative to the phylogenetic directory.
custom_rules:
- build-configs/ci/copy_example_data.smk
17 changes: 17 additions & 0 deletions phylogenetic/build-configs/ci/copy_example_data.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rule copy_example_data:
input:
sequences="example_data/sequences.fasta",
metadata="example_data/metadata.tsv",
output:
sequences="data/sequences.fasta",
metadata="data/metadata.tsv",
shell:
"""
cp -f {input.sequences} {output.sequences}
cp -f {input.metadata} {output.metadata}
"""

# Add a Snakemake ruleorder directive here if you need to resolve ambiguous rules
# that have the same output as the copy_example_data rule.

# ruleorder: copy_example_data > ...

0 comments on commit 15bebcb

Please sign in to comment.