Skip to content

Commit d2a9427

Browse files
committed
build: replace xvfb-run command with setup-xvfb action for headless testing
1 parent fdbc323 commit d2a9427

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: "Setup Xvfb"
16+
description: "Install and start Xvfb virtual display server for headless testing"
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Install Xvfb
21+
shell: bash
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y xvfb
25+
- name: Start Xvfb
26+
shell: bash
27+
run: |
28+
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
29+
echo "DISPLAY=:99.0" >> $GITHUB_ENV

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
- run: pnpm build
3838
- run: pnpm lint
3939
- run: pnpm check
40-
- run: xvfb-run -a --server-args="-screen 0 1024x768x24" pnpm test
40+
- uses: ./.github/actions/setup-xvfb
41+
- run: pnpm test
4142
- run: pnpm ci:package
4243
- run: |
4344
git config --global user.name "googleworkspace-bot"

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ jobs:
3131
- run: pnpm build
3232
- run: pnpm lint
3333
- run: pnpm check
34-
- run: xvfb-run -a --server-args="-screen 0 1024x768x24" pnpm test
34+
- uses: ./.github/actions/setup-xvfb
35+
- run: pnpm test
3536
- run: pnpm ci:package

.github/workflows/update.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
- run: pnpm ci:update
3232
- run: pnpm lint
3333
- run: pnpm check
34-
- run: xvfb-run -a --server-args="-screen 0 1024x768x24" pnpm test
34+
- uses: ./.github/actions/setup-xvfb
35+
- run: pnpm test
3536
- name: Check for changes
3637
id: changes
3738
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0

0 commit comments

Comments
 (0)