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