-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
86 lines (85 loc) · 2.28 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: "OpenAF's oJob action"
description: "Runs an OpenAF's oJob"
branding:
icon : 'command'
color: 'orange'
inputs:
ojob:
description: 'The oJob to run'
required: false
def:
description: 'The oJob definition in alternative to the ojob input'
required: false
oaf:
description: 'A OpenAF script file to run'
required: false
script:
description: 'The OpenAF script contents to execute'
required: false
args:
description: 'The oJob args to use'
required: false
dist:
description: 'The OpenAF distribution to use'
required: false
pwd :
description: 'Path to the working directory to use'
required: false
runs:
using: "composite"
steps:
# -------------------
# - name: Setup Java 21
# uses: actions/setup-java@v4
# with:
# java-version: 21
# distribution: 'temurin'
# - shell: bash
# name : check runtime
# run : |
# if [ ! -f /tmp/oaf/ojob ]; then
# CDIR=`pwd`
# mkdir /tmp/oaf
# cd /tmp/oaf
# curl https://openaf.io/${{ inputs.dist }}/openaf.jar.repacked -o openaf.jar
# java -jar openaf.jar --install
# cd $CDIR
# fi
- name : Setup OpenAF
uses : openaf/action-setup@v2
with :
dist: ${{ inputs.dist }}
- shell: bash
name : Check for def
if : ${{ inputs.def }}
run : |
echo ${{ format('''{0}''', inputs.def) }} > /tmp/temp.yaml
if [ "${{ inputs.pwd }}" != "" ]; then
cd ${{ inputs.pwd }}
fi
/tmp/oaf/ojob /tmp/temp.yaml ${{ inputs.args }}
- shell: bash
name : Check for oaf
if : ${{ inputs.oaf }}
run : |
if [ "${{ inputs.pwd }}" != "" ]; then
cd ${{ inputs.pwd }}
fi
/tmp/oaf/oaf -f ${{ inputs.oaf }} -e '${{ inputs.args }}'
- shell: bash
name : Check for script
if : ${{ inputs.script }}
run : |
echo ${{ format('''{0}''', inputs.script) }} > /tmp/temp.js
if [ "${{ inputs.pwd }}" != "" ]; then
cd ${{ inputs.pwd }}
fi
/tmp/oaf/oaf -f /tmp/temp.js -e '${{ inputs.args }}'
- shell: bash
name : Check for ojob
if : ${{ inputs.ojob }}
run : |
if [ "${{ inputs.pwd }}" != "" ]; then
cd ${{ inputs.pwd }}
fi
/tmp/oaf/ojob ${{ inputs.ojob }} ${{ inputs.args }}