Skip to content

Commit b5b11bc

Browse files
add prefix option, to match julia-runtest
1 parent f995fa4 commit b5b11bc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
project:
1111
description: 'Value passed to the --project flag. The default value is the repository root: "@."'
1212
default: '@.'
13+
prefix:
14+
description: 'Value inserted in front of the julia command, e.g. for running xvfb-run julia [...]'
15+
default: ''
16+
required: false
1317

1418
runs:
1519
using: 'composite'
@@ -31,5 +35,14 @@ runs:
3135
# packages via `Pkg.test`.
3236
JULIA_PKG_SERVER: ""
3337

34-
- run: julia --color=yes --project=${{ inputs.project }} -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
38+
- run: |
39+
# The Julia command that will be executed
40+
julia_cmd=( julia --color=yes --project=${{ inputs.project }} -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end' )
41+
42+
# Add the prefix in front of the command if there is one
43+
prefix="${{ inputs.prefix }}"
44+
[[ -n $prefix ]] && julia_cmd=( "$prefix" "${julia_cmd[@]}" )
45+
46+
# Run the Julia command
47+
"${julia_cmd[@]}"
3548
shell: bash

0 commit comments

Comments
 (0)