-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
64 lines (54 loc) · 2.1 KB
/
.gitlab-ci.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
image: node:latest
services:
- postgres:latest
variables:
DB_HOST: 'postgres'
DATABASE: 'postgres'
PASSWORD: 'postgres'
POSTGRES_PASSWORD: 'postgres'
test:
script:
# Dependencies for chromedriver, https://gist.github.com/mikesmullin/2636776#gistcomment-1742414
# Otherwise we get this error: "error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory"
- apt-get update -q -y
- apt-get --yes install libnss3
- apt-get --yes install libgconf-2-4
# Install chrome
# Based off of
# - https://gitlab.com/gitlab-org/gitlab-build-images/blob/9dadb28021f15913a49897126a0cd6ab0149e44f/scripts/install-chrome
# - https://askubuntu.com/a/510186/196148
#
# Add key
- curl -sS -L https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
# Add repo
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -q -y
- apt-get install -y google-chrome-stable
- useradd test
- su test
- npm install
- npm run test
coverage:
script:
# Dependencies for chromedriver, https://gist.github.com/mikesmullin/2636776#gistcomment-1742414
# Otherwise we get this error: "error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory"
- apt-get update -q -y
- apt-get --yes install libnss3
- apt-get --yes install libgconf-2-4
# Install chrome
# Based off of
# - https://gitlab.com/gitlab-org/gitlab-build-images/blob/9dadb28021f15913a49897126a0cd6ab0149e44f/scripts/install-chrome
# - https://askubuntu.com/a/510186/196148
#
# Add key
- curl -sS -L https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
# Add repo
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -q -y
- apt-get install -y google-chrome-stable
- useradd test
- su test
- npm install
- npm run test
- npm run coverage
allow_failure: true