Skip to content

Commit 4e975c6

Browse files
committed
use if: for xvfb
1 parent 264f0a0 commit 4e975c6

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

github-actions/ci-dist/action.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -181,30 +181,29 @@ runs:
181181
fi
182182
echo "::endgroup::"
183183
# Shared step for setting up graphical display.
184-
- name: Set up graphical display
184+
- name: Set up graphical display (via apt-get)
185185
shell: bash
186+
if: runner.os == 'Linux'
186187
run: |
187-
if ${{ toJSON(
188-
(
189-
fromJSON(inputs.build-enable-graphical-display || 'false')
190-
||
191-
fromJSON(inputs.test-enable-graphical-display || 'false')
192-
)
193-
) }}; then
194-
if ${{ toJSON( runner.os == 'Linux' ) }}; then
195-
echo "::group::Install xvfb (via apt-get)"
196-
sudo apt-get install --no-install-recommends -y xvfb
197-
mkdir /tmp/runtime-runner && chmod 0700 /tmp/runtime-runner
198-
echo "XDG_RUNTIME_DIR=/tmp/runtime-runner" >> $GITHUB_ENV
199-
if ${{ fromJSON(inputs.build-enable-graphical-display || 'false') }}; then
200-
echo "BUILD_RUNNER_PREFIX=xvfb-run -a" >> $GITHUB_ENV
201-
fi
202-
if ${{ fromJSON(inputs.test-enable-graphical-display || 'false') }}; then
203-
echo "TEST_RUNNER_PREFIX=xvfb-run -a" >> $GITHUB_ENV
204-
fi
205-
echo "::endgroup::"
206-
fi
188+
if ${{ toJSON(
189+
(
190+
fromJSON(inputs.build-enable-graphical-display || 'false')
191+
||
192+
fromJSON(inputs.test-enable-graphical-display || 'false')
193+
)
194+
) }}; then
195+
echo "::group::Install xvfb (via apt-get)"
196+
sudo apt-get install --no-install-recommends -y xvfb
197+
mkdir /tmp/runtime-runner && chmod 0700 /tmp/runtime-runner
198+
echo "XDG_RUNTIME_DIR=/tmp/runtime-runner" >> $GITHUB_ENV
199+
if ${{ fromJSON(inputs.build-enable-graphical-display || 'false') }}; then
200+
echo "BUILD_RUNNER_PREFIX=xvfb-run -a" >> $GITHUB_ENV
207201
fi
202+
if ${{ fromJSON(inputs.test-enable-graphical-display || 'false') }}; then
203+
echo "TEST_RUNNER_PREFIX=xvfb-run -a" >> $GITHUB_ENV
204+
fi
205+
echo "::endgroup::"
206+
fi
208207
# Target: target-setup-perl
209208
- name: target-setup-perl (actions-setup-perl)
210209
shell: bash

0 commit comments

Comments
 (0)