Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Browser-Performance.gitlab-ci.yml « Verify « templates « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c3113ffebf3d405f229000cac204c48565e65e79 (plain)
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
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Verify/Browser-Performance.gitlab-ci.yml

# Read more about the feature here: https://docs.gitlab.com/ee/ci/testing/browser_performance_testing.html

stages:
  - build
  - test
  - deploy
  - performance

browser_performance:
  stage: performance
  image: docker:git
  variables:
    URL: ''
    SITESPEED_IMAGE: sitespeedio/sitespeed.io
    SITESPEED_VERSION: 14.1.0
    SITESPEED_OPTIONS: ''
  services:
    - docker:stable-dind
  script:
    - mkdir gitlab-exporter
    # Busybox wget does not support proxied HTTPS, get the real thing.
    # See https://gitlab.com/gitlab-org/gitlab/-/issues/287611.
    - (env | grep -i _proxy= >/dev/null 2>&1) && apk --no-cache add wget
    - wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/1.1.0/index.js
    - mkdir sitespeed-results
    - |
      function propagate_env_vars() {
        CURRENT_ENV=$(printenv)

        for VAR_NAME; do
          echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
        done
      }
    - |
      docker run \
        $(propagate_env_vars \
          auto_proxy \
          https_proxy \
          http_proxy \
          no_proxy \
          AUTO_PROXY \
          HTTPS_PROXY \
          HTTP_PROXY \
          NO_PROXY \
        ) \
        --shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results $URL $SITESPEED_OPTIONS
    - mv sitespeed-results/data/performance.json browser-performance.json
  artifacts:
    paths:
      - sitespeed-results/
    reports:
      browser_performance: browser-performance.json