File tree Expand file tree Collapse file tree 2 files changed +34
-5
lines changed
Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 1212
1313jobs :
1414 build-and-test :
15- runs-on : ubuntu-latest
15+ runs-on : ${{ matrix.os }}
16+ strategy :
17+ matrix :
18+ # os: [ubuntu-latest, macos-latest, windows-latest]
19+ os : [macos-latest]
1620
1721 steps :
1822 - name : Checkout code
19- uses : actions/checkout@v3
23+ uses : actions/checkout@v4
2024
2125 - name : Set up Node.js
22- uses : actions/setup-node@v3
26+ uses : actions/setup-node@v4
2327 with :
2428 node-version : " 18"
2529
2630 - name : Install dependencies
2731 run : yarn install
2832
29- - name : Run tests
30- run : xvfb-run --auto-servernum yarn test
33+ - name : Install XQuartz on macOS
34+ if : runner.os == 'macOS'
35+ run : brew install xquartz xorg-server
36+
37+ # cf https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
38+ - name : Run tests with Xvfb (Linux) or XQuartz (macOS)
39+ run : |
40+ if [[ "$RUNNER_OS" == "Linux" ]]; then
41+ xvfb-run --auto-servernum yarn test
42+ else
43+ bash ./scripts/xvfb-run-macos.sh yarn test
44+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Start Xvfb if not running
4+ if ! pgrep -x " Xvfb" > /dev/null; then
5+ echo " Starting Xvfb on macOS..."
6+ Xvfb :99 -screen 0 1920x1080x24 &
7+ XVFB_PID=$!
8+ export DISPLAY=:99
9+ fi
10+
11+ # Run the command passed as arguments
12+ " $@ "
13+
14+ # Stop Xvfb after the command runs
15+ kill $XVFB_PID
You can’t perform that action at this time.
0 commit comments