Skip to content

Commit

Permalink
refactor: move xvfb to a separate action
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Aug 31, 2023
1 parent 716e4fb commit 5477630
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
25 changes: 25 additions & 0 deletions .github/actions/test-vscode/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test VS Code
description: Run the integration tests within VS Code

inputs:
command:
description: The test command to execute with xvfb-run
required: true
type: string

runs:
using: composite
steps:
- name: 🧪 Test on Linux
if: ${{ runner.os == 'Linux' }}
run: xvfb-run -a ${{ inputs.command }}
shell: bash
env:
# Unset wrong Electorn setting,
# see: https://github.com/microsoft/vscode-test/issues/127
DBUS_SESSION_BUS_ADDRESS: null

- name: 🧪 Test on MacOS/Windows
if: ${{ runner.os != 'Linux' }}
run: ${{ inputs.command }}
shell: bash
20 changes: 8 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: 🏗 Setup project
uses: ./.github/actions/setup-project

- name: Test scripts
- name: 🧪 Test scripts
run: npm run test:scripts

bundled:
Expand Down Expand Up @@ -64,9 +64,10 @@ jobs:
npm install --no-package-lock --ignore-scripts
- name: 🧪 Test project
run: xvfb-run -a npm run test:vscode
uses: ./.github/actions/test-vscode
with:
command: npm run test:vscode
env:
DBUS_SESSION_BUS_ADDRESS: null
VSCODE_VERSION: stable

vscode:
Expand Down Expand Up @@ -100,12 +101,7 @@ jobs:
: vscode
core.exportVariable('VSCODE_VERSION', target)
- name: 🧪 Test project (Linux)
if: ${{ runner.os == 'Linux' }}
run: xvfb-run -a npm run test:vscode
env:
DBUS_SESSION_BUS_ADDRESS: null

- name: 🧪 Test project (MacOS/Windows)
if: ${{ runner.os != 'Linux' }}
run: npm run test:vscode
- name: 🧪 Test project
uses: ./.github/actions/test-vscode
with:
command: npm run test:vscode

0 comments on commit 5477630

Please sign in to comment.