@@ -28,24 +28,66 @@ jobs:
28
28
with :
29
29
bundler-cache : true
30
30
ruby-version : ${{ matrix.ruby }}
31
+ - name : Install gem
32
+ run : gem install syntax_tree
31
33
- name : Compile extension
32
34
run : |
33
35
yarn install --frozen-lockfile
34
36
yarn compile
35
- - name : Install gem
36
- run : gem install syntax_tree
37
- - name : Setup upterm session
38
- uses : lhotari/action-upterm@v1
39
- with :
40
- limit-access-to-actor : true
41
- - name : Run tests
37
+ - name : Setup GUI Environment
42
38
run : |
43
- sudo apt install dbus-x11
44
- dbus-launch xvfb-run -a npm test
39
+ sudo apt-get install -yq dbus-x11 ffmpeg > /dev/null
40
+ mkdir -p ~/bin
41
+ mkdir -p ~/var/run
42
+ cat <<EOF > ~/bin/xvfb-shim
43
+ #! /bin/bash
44
+ echo DISPLAY=\$DISPLAY >> ${GITHUB_ENV}
45
+ echo XAUTHORITY=\$XAUTHORITY >> ${GITHUB_ENV}
46
+ sleep 86400
47
+ EOF
48
+ chmod a+x ~/bin/xvfb-shim
49
+ dbus-launch >> ${GITHUB_ENV}
50
+ start-stop-daemon --start --quiet --pidfile ~/var/run/Xvfb.pid --make-pidfile --background --exec /usr/bin/xvfb-run -- ~/bin/xvfb-shim
51
+ echo -n "Waiting for Xvfb to start..."
52
+ while ! grep -q DISPLAY= ${GITHUB_ENV}; do
53
+ echo -n .
54
+ sleep 3
55
+ done
45
56
if : runner.os == 'Linux'
46
- - name : Run tests
57
+ - name : Start Screen Recording
58
+ run : |
59
+ no_close=--no-close # uncomment to see ffmpeg output (i.e. leave stdio open)
60
+ start-stop-daemon $no_close --start --quiet --pidfile ~/var/run/ffmpeg.pid --make-pidfile --background --exec /usr/bin/ffmpeg -- -nostdin -f x11grab -video_size 1280x1024 -framerate 10 -i ${DISPLAY}.0+0,0 $PWD/test.mp4
61
+ pid=`cat ~/var/run/ffmpeg.pid`
62
+ echo "Waiting for ffmpeg (pid $pid) to start recording (display $DISPLAY)..."
63
+ while [ ! -f $PWD/test.mp4 ]; do
64
+ echo -n .
65
+ sleep 3
66
+ done
67
+ if : runner.os == 'Linux'
68
+ # - name: Setup SSH Debugging
69
+ # uses: lhotari/action-upterm@v1
70
+ # with:
71
+ # limit-access-to-actor: true
72
+ - name : Run Tests
47
73
run : npm test
48
- if : runner.os != 'Linux'
74
+ - name : Stop Screen Recording
75
+ run : |
76
+ start-stop-daemon --stop --pidfile ~/var/run/ffmpeg.pid
77
+ sleep 3
78
+ if : always() && runner.os == 'Linux'
79
+ - name : Archive Screen Recording
80
+ uses : actions/upload-artifact@v3
81
+ with :
82
+ name : test-video
83
+ path : |
84
+ test.mp4
85
+ if : always() && runner.os == 'Linux'
86
+ - name : Teardown GUI Environment
87
+ run : |
88
+ start-stop-daemon --stop --pidfile ~/var/run/Xvfb.pid
89
+ kill $DBUS_SESSION_BUS_PID
90
+ if : always() && runner.os == 'Linux'
49
91
automerge :
50
92
name : AutoMerge
51
93
needs : ci
0 commit comments