-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
64 lines (58 loc) · 1.71 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
name: Setup OpenModelica
author: Kristian Zarebski
description: Setup installation of OpenModelica
inputs:
libraries:
description: OpenModelica Libraries to Install
required: false
default: ''
msl-version:
description: Version of Modelica Standard Library
required: false
default: '4.0.0'
cpp-runtime-library:
description: Install C++ Runtime Library
required: false
default: 'false'
model-name:
description: Name of model to build
required: false
default: 'false'
model-source-path:
description: Path to modelica source to build and run
required: false
default: 'false'
script-path:
description: Path to Modelica script .mos file
required: false
default: ''
script:
description: Modelica script to run
required: false
default: ''
runs:
using: "composite"
steps:
- name: Install OpenModelica
run: |
INSTALL_OMC_CPP_LIBS=${{ inputs.cpp-runtime-library }} \
MODEL_SOURCE_PATH=${{ inputs.model-source-path }} \
MODEL_NAME=${{ inputs.model-name }} \
$GITHUB_ACTION_PATH/install-om.sh Modelica@${{ inputs.msl-version }} $(echo "${{ inputs.libraries }}" | xargs)
shell: bash
- name: Run Modelica Script
run: |
if [ -z "${{ inputs.script-path }}" ]; then echo "No OMShell script to run"; exit 0; fi
omc ${{ inputs.script-path }}
shell: bash
- name: Run OMShell
run: |
if [ -z "${{ inputs.script }}" ]; then echo "No OMShell commands to run"; exit 0; fi
printf '${{ inputs.script }}' > runScript.mos
echo "Created script: "
cat runScript.mos
omc runScript.mos
shell: bash
branding:
icon: trending-up
color: blue