Skip to content

Commit

Permalink
Fail fast when nextstrain-pathogen.yaml file is missing [#92]
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Jun 12, 2024
1 parent 7f910e6 commit 175d648
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pathogen-repo-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ jobs:
ref: ${{ needs.workflow-context.outputs.sha }}
path: ${{ env.NEXTSTRAIN_GITHUB_DIR }}

- name: Verify nextstrain-pathogen.yaml file
run: >
if [[ ! -f nextstrain-pathogen.yaml ]]; then
echo "To use this workflow, there must be a 'nextstrain-pathogen.yaml' file present in the repository root";
exit 1;
fi
- name: Set up Nextstrain runtime ${{ matrix.runtime }}
uses: ./.git/nextstrain/.github/actions/setup-nextstrain-cli
with:
Expand Down
4 changes: 2 additions & 2 deletions actions/run-nextstrain-ci-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ runs:
env:
DIR: ${{ inputs.directory }}
run: |
if [[ -f nextstrain-pathogen.yaml && -f "$DIR"/Snakefile && -f "$DIR"/build-configs/ci/config.yaml ]]; then
if [[ -f "$DIR"/Snakefile && -f "$DIR"/build-configs/ci/config.yaml ]]; then
nextstrain check-setup ${{ inputs.runtime }} --set-default
nextstrain build "$DIR" --configfile build-configs/ci/config.yaml
else
echo "Skipping $DIR build due to one or more missing files."
for i in nextstrain-pathogen.yaml "$DIR"/Snakefile "$DIR"/build-configs/ci/config.yaml; do
for i in "$DIR"/Snakefile "$DIR"/build-configs/ci/config.yaml; do
[[ -f $i ]] || echo missing "$i"
done
fi
Expand Down

0 comments on commit 175d648

Please sign in to comment.