Skip to content

Commit

Permalink
Refactor pathogen-repo-ci to be smarter [#89]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed May 31, 2024
1 parent 6d8f901 commit 090a35e
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 8 deletions.
74 changes: 66 additions & 8 deletions .github/workflows/pathogen-repo-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,74 @@ jobs:
with:
runtime: ${{ matrix.runtime }}

- name: Run ingest
uses: nextstrain/.github/actions/run-nextstrain-build@update-ci-89
with:
step: ingest

# run: |
# if [[ -f nextstrain-pathogen.yaml && -f ingest/Snakefile && -f ingest/build-configs/ci/config.yaml ]]; then
# nextstrain build ingest --configfile build-configs/ci/config.yaml ${{ inputs.build-args }}
# else
# echo "Skipping ingest build due to one or more missing files."
# for i in nextstrain-pathogen.yaml ingest/Snakefile ingest/build-configs/ci/config.yaml; do
# ! test -f $i && echo missing $i
# done
# fi

# - name: Upload ingest artifact
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: ingest-${{ inputs.artifact-name }}-${{ matrix.runtime }}
# path: |
# ingest/results/
# ingest/benchmarks/
# ingest/logs/
# ingest/.snakemake/log/

- name: Run phylogenetic
run: |
if [[ -f nextstrain-pathogen.yaml && -f phylogenetic/Snakefile && -f phylogenetic/build-configs/ci/config.yaml ]]; then
nextstrain build phylogenetic --configfile build-configs/ci/config.yaml ${{ inputs.build-args }}
else
echo "Skipping phylogenetic build due to one or more missing files."
for i in nextstrain-pathogen.yaml phylogenetic/Snakefile phylogenetic/build-configs/ci/config.yaml; do
! test -f $i && echo missing $i
done
fi
- run: nextstrain build . ${{ inputs.build-args }}
- name: Upload phylogenetic artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: phylogenetic-${{ inputs.artifact-name }}-${{ matrix.runtime }}
path: |
phylogenetic/auspice/
phylogenetic/results/
phylogenetic/benchmarks/
phylogenetic/logs/
phylogenetic/.snakemake/log/
- name: Run nextclade
run: |
if [[ -f nextstrain-pathogen.yaml && -f nextclade/Snakefile && -f nextclade/build-configs/ci/config.yaml ]]; then
nextstrain build nextclade --configfile build-configs/ci/config.yaml ${{ inputs.build-args }}
else
echo "Skipping nextclade build due to one or more missing files."
for i in nextstrain-pathogen.yaml nextclade/Snakefile nextclade/build-configs/ci/config.yaml; do
! test -f $i && echo missing $i
done
fi
- if: always()
- name: Upload nextclade artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}-${{ matrix.runtime }}
name: nextclade-${{ inputs.artifact-name }}-${{ matrix.runtime }}
path: |
auspice/
results/
benchmarks/
logs/
.snakemake/log/
nextclade/auspice/
nextclade/results/
nextclade/benchmarks/
nextclade/logs/
nextclade/.snakemake/log/
38 changes: 38 additions & 0 deletions actions/run-nextstrain-build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: run-nextstrain-build
description: >-
Runs a single `nextstrain build` command in a given sub-directory of
a pathogen repo. Must be provided with the name of the
sub-directory.
inputs:
step:
description: The name of the sub-directory to run the build from
type: string
required: true

runs:
steps:
- name: Run ${{ inputs.step }}
env:
STEP: ${{ inputs.step }}
run: |
if [[ -f nextstrain-pathogen.yaml && -f $STEP/Snakefile && -f $STEP/build-configs/ci/config.yaml ]]; then
nextstrain build $STEP --configfile build-configs/ci/config.yaml
else
echo "Skipping $STEP build due to one or more missing files."
for i in nextstrain-pathogen.yaml $STEP/Snakefile $STEP/build-configs/ci/config.yaml; do
! test -f $i && echo missing $i
done
fi
shell: bash

- name: Upload ${{ inputs.step }} artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{inputs.step }}-outputs-${{ matrix.runtime }}
path: |
${{ inputs.step }}/results/
${{ inputs.step }}/benchmarks/
${{ inputs.step }}/logs/
${{ inputs.step }}/.snakemake/log/

0 comments on commit 090a35e

Please sign in to comment.