-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathaction.yaml
73 lines (61 loc) · 2.25 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# If you update this action, please update the hardcoded ref to it in
# .github/workflows/pathogen-repo-ci.yaml. See the commentary there for why
# it's necessary.
name: Setup Nextstrain CLI
description: >-
This GitHub Actions action is intended to be called by workflows in our other
repos when they need a working copy of the Nextstrain CLI (the `nextstrain`
program) installed and don't particularly care about the exact Python
environment in which its installed.
For example, this is typically the case when the workflow's primary step
invokes `nextstrain build` to run a build in a container runtime (locally via
Docker or remotely via AWS Batch). Workflows that are more complex (e.g.
have additional dependencies to install, care about Conda, etc.) should
probably continue to install the Nextstrain CLI themselves for now.
inputs:
cli-version:
description: >-
Version of Nextstrain CLI to install, as a dependency version spec
understood by Pip (i.e. conforming to PEP-0508, e.g. >3.2 or ==3.2.4).
Defaults to none, which means the latest version available will be
installed.
type: string
default: ""
required: false
runtime:
description: >-
Nextstrain runtime to configure and set as the default, as a string
understood by `nextstrain setup`. Defaults to "docker".
type: string
default: docker
required: false
python-version:
description: >-
Version of Python to use for Nextstrain CLI, as a string understood by
actions/setup-python. Defaults to "3.9".
type: string
default: "3.9"
required: false
runs:
using: composite
steps:
- uses: actions/setup-python@v3
with:
python-version: "${{ inputs.python-version }}"
- run: python3 -m pip install --upgrade pip setuptools wheel
shell: bash
- run: python3 -m pip install --upgrade nextstrain-cli"$version"
shell: bash
env:
version: ${{ inputs.cli-version }}
- run: nextstrain version
shell: bash
- run: nextstrain setup --set-default "$runtime"
shell: bash
env:
runtime: ${{ inputs.runtime }}
- run: nextstrain update
shell: bash
continue-on-error: true
- run: nextstrain version --verbose
shell: bash