From 890af9b96984b027613b26db4457cca1afca9fda Mon Sep 17 00:00:00 2001 From: Scion Date: Sat, 5 Aug 2023 20:18:18 -0700 Subject: [PATCH] Updated actions to not use graphics by default. --- unity-command/action.yaml | 14 +++++++++++++- unity-project/action.yaml | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/unity-command/action.yaml b/unity-command/action.yaml index 9b42790..dcfc55c 100644 --- a/unity-command/action.yaml +++ b/unity-command/action.yaml @@ -24,6 +24,10 @@ inputs: command: description: "Unity command to run." required: false + useGraphics: + description: "Whether or not to use the user graphics device when running Unity." + required: false + default: "false" unityBuilder: description: "Whether or not to use the UnityBuilder instead of a Unity command." required: false @@ -54,6 +58,14 @@ runs: docker tag $CACHED_CONTAINER ${{ inputs.imageTag }} shell: bash + - name: "Get Unity Command" + id: command + run: | + COMMAND="${{ inputs.command }}" + if [[ "{{ inputs.useGraphics }}" != "true" ]]; then + COMMAND="$COMMAND -nographics" + fi + echo "command=$COMMAND" - name: "Run Unity command." uses: act/unity/unity@master with: @@ -61,7 +73,7 @@ runs: # serial: "activated" email: ${{ inputs.email }} password: ${{ inputs.password }} - command: ${{ inputs.command }} + command: ${{ steps.command.outputs.command }} unityBuilder: ${{ inputs.unityBuilder }} - name: "Remove temporary image." if: ${{ inputs.removeContainer == 'true' }} diff --git a/unity-project/action.yaml b/unity-project/action.yaml index 2e38e24..d93f849 100644 --- a/unity-project/action.yaml +++ b/unity-project/action.yaml @@ -24,6 +24,10 @@ inputs: unityBuilder: description: "Whether or not to use the UnityBuilder instead of a Unity command." required: false + useGraphics: + description: "Whether or not to use the user graphics device when running Unity." + required: false + default: "false" cacheVolume: description: "Name of the volume to cache the Library folder to." required: false @@ -60,6 +64,7 @@ runs: password: ${{ inputs.password }} command: -projectPath ${{ inputs.projectPath }} -buildTarget ${{ steps.getTarget.outputs.buildTarget }} ${{ inputs.command }} removeContainer: ${{ inputs.removeContainer }} + useGraphics: ${{ inputs.useGraphics }} - name: "Cache the Library folder." if: inputs.cacheVolume != null uses: act/common/docker/docker-cp@master