Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pathogen-repo-ci to run workflow in subdir via build-dir arg #62

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
with:
repo: nextstrain/zika-tutorial

test-pathogen-repo-ci-with-build-dir:
uses: ./.github/workflows/pathogen-repo-ci.yaml
with:
repo: nextstrain/monkeypox
build-dir: phylogenetic
artifact-name: mpox-phylogenetic

test-pathogen-repo-ci-failure:
uses: ./.github/workflows/pathogen-repo-ci.yaml
with:
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/pathogen-repo-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ on:
- conda
required: false

build-dir:
description: >-
The directory used for `nextstrain build`.
If provided, example data should be in an `example_data` directory
relative to this directory.
Defaults to the root of the repository.
type: string
default: "."
required: false

artifact-name:
description: >-
Name to use for build results artifact uploaded at the end of the
Expand Down Expand Up @@ -94,12 +104,20 @@ jobs:
- id: inputs
env:
runtimes: ${{ inputs.runtimes }}
build_dir: ${{ inputs.build-dir }}
shell: bash
run: |
runtimes="$(yq --output-format=json --indent=0 . <<<"$runtimes")"
echo runtimes="$runtimes" | tee -a "$GITHUB_OUTPUT"

# Remove potential trailing slash and set default to current directory
build_dir="${build_dir%/}"
build_dir="${build_dir:-'.'}"
echo build_dir="$build_dir" | tee -a "$GITHUB_OUTPUT"

outputs:
runtimes: ${{ steps.inputs.outputs.runtimes }}
build_dir: ${{ steps.inputs.outputs.build_dir }}

build:
needs: configuration
Expand Down Expand Up @@ -228,6 +246,7 @@ jobs:
python-version: "3.7"

- name: Copy example data
working-directory: ${{ needs.configuration.outputs.build_dir }}
run: |
if [[ -d example_data ]]; then
mkdir -p data/
Expand All @@ -237,14 +256,15 @@ jobs:
fi

- run: nextstrain build . ${{ inputs.build-args }}
working-directory: ${{ needs.configuration.outputs.build_dir }}

- if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact-name }}-${{ matrix.runtime }}
path: |
auspice/
results/
benchmarks/
logs/
.snakemake/log/
${{ needs.configuration.outputs.build_dir }}/auspice/
${{ needs.configuration.outputs.build_dir }}/results/
${{ needs.configuration.outputs.build_dir }}/benchmarks/
${{ needs.configuration.outputs.build_dir }}/logs/
${{ needs.configuration.outputs.build_dir }}/.snakemake/log/
Loading