action
This commit is contained in:
parent
924e44a9d9
commit
886fcf3673
1 changed files with 22 additions and 9 deletions
|
@ -44,7 +44,7 @@ def clone_project_branch() -> None:
|
|||
)
|
||||
|
||||
|
||||
def install_actions(path: Path) -> None:
|
||||
def install_actions() -> None:
|
||||
"""Make actions usable in workflows.
|
||||
|
||||
:param path: entry point file
|
||||
|
@ -54,20 +54,33 @@ def install_actions(path: Path) -> None:
|
|||
name = "action.yaml"
|
||||
root = project.root / "act"
|
||||
vpy = Path(env.SPCD_PYTHON_VENV_BINARIES) / "python"
|
||||
action = "synchronize"
|
||||
for action in ["action", "synchronize"]:
|
||||
log.info(action)
|
||||
directory = root / action
|
||||
fs.make_directory(directory)
|
||||
fs.write(directory / name, f"""\
|
||||
match action:
|
||||
case "action":
|
||||
yaml = """\
|
||||
inputs:
|
||||
arg-1:
|
||||
required: true
|
||||
arg_2:
|
||||
required: true
|
||||
"""
|
||||
case "synchronize":
|
||||
yaml = """\
|
||||
inputs:
|
||||
source:
|
||||
default: out
|
||||
required: false
|
||||
"""
|
||||
yaml = f"""{yaml}\
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: {vpy} -m spcd synchronize
|
||||
""")
|
||||
- run: {vpy} -m spcd {action}
|
||||
"""
|
||||
fs.write(directory / name, yaml)
|
||||
cat(directory / name)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue