Skip to content

Commit fc4a6f4

Browse files
committed
Add example-build
The main motivation for this is to simplify the CI build-args which will need to be replicated across augur, docker-base, and conda-base. Note the CI config uses the repo's local example_data as inputs and the paths are relative to the top level directory, so the workflow can only be run from the top level directory.
1 parent e5e6b89 commit fc4a6f4

4 files changed

Lines changed: 32 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ jobs:
1212
uses: nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml@v0
1313
with:
1414
build-args: |
15-
--snakefile segment-focused/Snakefile \
16-
-pf test_target \
17-
--config 'inputs=[{"name": "example", "metadata": "example_data/gisaid/metadata.tsv", "sequences": "example_data/gisaid/sequences_{segment}.fasta"}]'
15+
--snakefile build-configs/ci/Snakefile

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,13 @@ additional_inputs:
297297

298298
### Run a single H5N1 HA all-time analysis
299299

300-
There is a `test_target` rule which will produce a single H5N1 HA "all-time" tree.
301-
You can combine this with the example data (see above) to run a single build using a small number of sequences:
300+
There is an example build which will produce a single H5N1 HA "all-time" tree
301+
using the example data (see above):
302302

303303

304304
``` bash
305305
snakemake --cores 2 \
306-
--snakefile segment-focused/Snakefile \
307-
--config 'inputs=[{"name": "example", "metadata": "example_data/gisaid/metadata.tsv", "sequences": "example_data/gisaid/sequences_{segment}.fasta"}]' \
308-
-pf test_target
306+
--snakefile build-configs/ci/Snakefile
309307
```
310308

311309
### clade labeling

build-configs/ci/Snakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This needs to be defined before rules/config.smk so that the `configfile`
2+
# defined in there will be merged on top of this one. This allows us to use the
3+
# segment-focused config as the base config that is overridden by the
4+
# ci/config.yaml, which defines a single build and use example data as inputs.
5+
configfile: os.path.join(workflow.basedir, '../../segment-focused/config.yaml')
6+
7+
include: "../../rules/config.smk"
8+
9+
include: "../../rules/main.smk"
10+
11+
rule _all:
12+
input: rules.all.input

build-configs/ci/config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Produces single build: auspice/avian-flu_h5n1_ha_all-time.json
2+
builds:
3+
- subtype:
4+
- h5n1
5+
segment:
6+
- ha
7+
time:
8+
- all-time
9+
10+
# Inputs relative to the top level directory so this will only work running
11+
# the workflow from the top level directory
12+
inputs:
13+
- name: example-data
14+
metadata: example_data/gisaid/metadata.tsv
15+
sequences:
16+
ha: example_data/gisaid/sequences_ha.fasta

0 commit comments

Comments
 (0)