-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy path.gitlab-ci.yml
132 lines (115 loc) · 3.13 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# This file is part of Adblock Plus <https://adblockplus.org/>,
# Copyright (C) 2006-present eyeo GmbH
#
# Adblock Plus is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# Adblock Plus is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
#
# This file specifies how GitLab should run the tests, linting and other checks
# automatically when merge requests are opened. By default, this will all run
# on GitLab provided "shared runners", without further work. However, the tests
# will run more quickly on a "specific runner" if you'd like to set that up.
#
# If you'd like to provision your own specific runners for your fork of the
# repository, you can use these Ansible roles:
#
# https://gitlab.com/eyeo/devops/ansible-role-adblockplus-builder
# https://gitlab.com/eyeo/devops/ansible-role-gitlab-runner
---
stages:
- default
- pages
image: "registry.gitlab.com/eyeo/docker/adblockplus-ci:node16-no-python"
variables:
npm_config_audit: "false"
.default_template:
stage: default
before_script:
- npm install
retry:
max: 2
when: stuck_or_timeout_failure
tests:
extends: .default_template
script:
- npm test
- npm run test:dist
cache:
key: global-cache
paths:
- chromium-snapshots/download-cache/
- firefox-snapshots/download-cache/
benchmark:
extends: .default_template
script:
- npm run benchmark
- npm run benchmark:save
- npm run benchmark:compare
.testpages:
image: docker:19.03.5
tags:
- docker
stage: default
services:
- docker:19.03.5-dind
before_script:
- docker info
variables:
DOCKER_DRIVER: overlay2
interruptible: true
script:
- docker build -t testpages .
- docker run --shm-size=256m -e BROWSER="$BROWSER" -e TESTS_EXCLUDE="Snippets|CSP|Header" testpages
after_script:
- IMAGE_ID=$(docker ps -aqf ancestor=testpages)
- docker cp $IMAGE_ID:/testpages.adblockplus.org/test/screenshots .
2> /dev/null
- docker cp $IMAGE_ID:/var/log/nginx/ .
artifacts:
paths:
- screenshots/
- nginx/
when: on_failure
expire_in: 1 mo
testpages:chrome:latest:
extends: .testpages
variables:
BROWSER: Chromium \(latest\)
testpages:chrome:oldest:
extends: .testpages
variables:
BROWSER: Chromium \(oldest\)
testpages:firefox:latest:
extends: .testpages
variables:
BROWSER: Firefox \(latest\)
testpages:firefox:oldest:
extends: .testpages
variables:
BROWSER: Firefox \(oldest\)
docs:
extends: .default_template
script:
- npm run docs
artifacts:
paths:
- build/docs/
expire_in: 3 mos
audit:
extends: .default_template
script:
- npm audit
allow_failure: true
.pages:
stage: pages
dependencies:
- docs
include: ".gitlab-pages.yml"