-
-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (97 loc) · 3.1 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Main
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build Distributables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: yarn
- name: Compile extension
run: |
yarn install --frozen-lockfile
yarn lint
yarn compile
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: yarn
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.2'
- name: Install a supported version of the RuboCop gem
run: gem install rubocop
- name: Compile Tests
run: |
yarn install --frozen-lockfile
yarn test-compile
- name: Setup GUI Environment
run: |
sudo apt-get update
sudo apt-get install -yq dbus-x11 ffmpeg > /dev/null
mkdir -p ~/bin
mkdir -p ~/var/run
cat <<EOF > ~/bin/xvfb-shim
#! /bin/bash
echo DISPLAY=\$DISPLAY >> ${GITHUB_ENV}
echo XAUTHORITY=\$XAUTHORITY >> ${GITHUB_ENV}
sleep 86400
EOF
chmod a+x ~/bin/xvfb-shim
dbus-launch >> ${GITHUB_ENV}
start-stop-daemon --start --quiet --pidfile ~/var/run/Xvfb.pid --make-pidfile --background --exec /usr/bin/xvfb-run -- ~/bin/xvfb-shim
echo -n "Waiting for Xvfb to start..."
while ! grep -q DISPLAY= ${GITHUB_ENV}; do
echo -n .
sleep 3
done
if: runner.os == 'Linux'
- name: Start Screen Recording
run: |
mkdir -p $PWD/videos-raw
no_close=--no-close # uncomment to see ffmpeg output (i.e. leave stdio open)
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/videos-raw/test.mp4
if: runner.os == 'Linux'
- name: Cache VS Code Binary
id: vscode-test
uses: actions/cache@v3
with:
path: .vscode-test/
key: ${{ runner.os }}-vscode-test
- name: Run Tests
run: yarn test
- name: Stop Screen Recording
run: |
start-stop-daemon --stop --pidfile ~/var/run/ffmpeg.pid
sleep 3
mkdir -p $PWD/videos
for f in $PWD/videos-raw/*.mp4; do
out=`basename $f`
ffmpeg -i $f -vf format=yuv420p $PWD/videos/$out
done
if: always() && runner.os == 'Linux'
- name: Archive Screen Recording
uses: actions/upload-artifact@v3
with:
name: videos
path: |
videos/
if: always() && runner.os == 'Linux'
- name: Teardown GUI Environment
run: |
start-stop-daemon --stop --pidfile ~/var/run/Xvfb.pid
kill $DBUS_SESSION_BUS_PID
if: always() && runner.os == 'Linux'