forked from paradoxxxzero/gnome-shell-system-monitor-applet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
72 lines (58 loc) · 2.33 KB
/
.travis.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
# https://docs.travis-ci.com/user/multi-os/
# https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments
dist: xenial
sudo: required
language: python
python: 2.7
env:
- MAX_CPU_PERCENT=20 MAX_MEM_PERCENT=5
install:
- sudo apt-key update
- sudo apt-get -yq update
- sudo apt -yq install xvfb gnome-shell
# Install NodeJS from upstream, since the version that comes with Ubuntu 14 is ancient.
# https://askubuntu.com/a/548776/13217
- sudo apt-get -yq install curl
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- sudo apt-get install -yq nodejs
# Necessary on some versions of Ubuntu 14, which has a malformed npm/nodejs package.
- sudo bash -c "[ ! -f /usr/bin/node ] && ln -s /usr/bin/nodejs /usr/bin/node || true"
- which nodejs
- which node
# Install NPM from upstream.
- git clone git://github.com/npm/cli.git
- cd cli/scripts
- chmod +x install.sh
- sudo ./install.sh
- cd ../..
- sudo npm install -g eslint
before_script:
- "export DISPLAY=:99.0"
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"
- sleep 3 # give xvfb some time to start
- sudo gnome-shell &
- sleep 3 # give gnome-shell some time to start
script:
# Clear initial gnome-shell errors we don't care about.
- sudo journalctl /usr/bin/gnome-shell
- sudo journalctl --rotate
- sudo journalctl --vacuum-time=1s
# Show pre-extension gnome-shell performance.
- ps -C gnome-shell -o %cpu,%mem,cmd
# Run JSlint check.
- cd $TRAVIS_BUILD_DIR
- ./checkjs.sh
# Install and enable extension.
- sudo make install
- gnome-shell-extension-tool [email protected]
# Give extension time to run.
- sleep 10
# Show post-extension gnome-shell performance.
- ps -C gnome-shell -o %cpu,%mem,cmd
# Check CPU. On localhost with 2.80GHz x 4 takes ~3%, on Travis ~15%.
- bash -c '[[ $(bc <<< "$(ps -C gnome-shell -o %cpu|tail -1) < $MAX_CPU_PERCENT") -eq 1 ]]'
# Check memory. On localhost with 32GB of memory, ~0.6%, on Travis ~3%.
- bash -c '[[ $(bc <<< "$(ps -C gnome-shell -o %mem|tail -1) < $MAX_MEM_PERCENT") -eq 1 ]]'
# Confirm extension hasn't thrown any errors.
- sudo journalctl /usr/bin/gnome-shell
- sudo journalctl /usr/bin/gnome-shell|grep "\-\- No entries \-\-"