-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
72 lines (68 loc) · 2.15 KB
/
action.yml
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
name: "jPipe Runner"
description: "GitHub Action to run justification diagrams of jpipe"
author: "Jason Lyu"
inputs:
jd_file:
description: "Path to the justification .jd file"
required: true
variable:
description: "Define one or more variables in the format NAME:VALUE, separated by newlines"
required: false
library:
description: "Specify one or more Python libraries to load, separated by newlines"
required: false
diagram:
description: "Specify diagram pattern or wildcard"
required: false
default: "*"
dry_run:
description: "Perform a dry run without actually executing justifications"
required: false
default: "false"
version:
description: "jPipe Runner version to use, e.g. '0.0.1'. The main branch version is used by default"
required: false
default: "main"
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
shell: bash
env:
DEBIAN_FRONTEND: "noninteractive"
run: |
sudo apt-get install \
--no-install-recommends \
--no-install-suggests -y \
graphviz graphviz-dev
pip install -U 'git+https://github.com/ace-design/jpipe-runner.git@${{ inputs.version }}'
- name: Run jpipe-runner
shell: bash
run: |
CMD="python -m jpipe_runner '${{ inputs.jd_file }}'"
if [[ "${{ inputs.variable }}" != "" ]]; then
while IFS= read -r line; do
if [[ -n "$line" ]]; then
CMD+=" --variable '${line}'"
fi
done <<< "${{ inputs.variable }}"
fi
if [[ "${{ inputs.library }}" != "" ]]; then
while IFS= read -r line; do
if [[ -n "$line" ]]; then
CMD+=" --library '${line}'"
fi
done <<< "${{ inputs.library }}"
fi
if [[ "${{ inputs.diagram }}" != "" ]]; then
CMD+=" --diagram '${{ inputs.diagram }}'"
fi
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
CMD+=" --dry-run"
fi
echo "Running command: $CMD"
eval $CMD