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

pathogen-repo-ci: Add input for GH Action runner #103

Open
joverlee521 opened this issue Jul 22, 2024 · 2 comments
Open

pathogen-repo-ci: Add input for GH Action runner #103

joverlee521 opened this issue Jul 22, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@joverlee521
Copy link
Contributor

Based on @victorlin's proposed solution in nextstrain/conda-base#83

In nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml, add an input to be passed to jobs.build.runs-on.

Example in d4fa54a is built on v0, but similar changes can be made to the latest version of the pathogen-repo-ci.

@joverlee521
Copy link
Contributor Author

Seems like we can do something similar to the runtimes input

  1. Allow specifying multiple in YAML format in input

runtimes:
description: >-
List of Nextstrain runtimes under which to run the build, as a string containing YAML. This is easily produced, for example, by pretending you're writing normal nested YAML within a literal multi-line block scalar (introduced by "|"):
with:
runtimes: |
- docker
- conda
Defaults to "docker" and "conda". One job per runtime will be run.

  1. Parse YAML into JSON

- id: inputs
env:
runtimes: ${{ inputs.runtimes }}
shell: bash
run: |
runtimes="$(yq --output-format=json --indent=0 . <<<"$runtimes")"
echo runtimes="$runtimes" | tee -a "$GITHUB_OUTPUT"
outputs:
runtimes: ${{ steps.inputs.outputs.runtimes }}

  1. Parse JSON into matrix for the build job

nextstrain-build:
needs: [configuration, workflow-context]
strategy:
fail-fast: false
matrix:
runtime: ${{ fromJSON(needs.configuration.outputs.runtimes) }}

@victorlin
Copy link
Member

Seems like we can do something similar to the runtimes input

+1 for this compared to my prototype which defines the list of runners on the matrix with the repo name. It makes more sense to have runners x runtimes, although the similar terminology may be confusing!

@victorlin victorlin self-assigned this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants