.gitlab-ci.yml 927 Bytes
Newer Older
Eduardo Sanz García's avatar
Eduardo Sanz García committed
1 2 3 4 5
# Needed to launch the image
variables:
  USER_ID: "$(id -u)"
  GROUP_ID: "$(id -g)"

6 7 8
stages:
  - test
  - build
9
  - docs
10 11

before_script:
12
  - yarn install --frozen-lockfile --cache-folder .yarn
13 14 15 16 17
  - yarn ng --version

cache:
  key: "${CI_COMMIT_REF_SLUG}"
  paths:
18
    - .yarn
19 20 21

lint:
  stage: test
22
  image: node:alpine
23
  tags: [docker]
Eduardo Sanz García's avatar
Eduardo Sanz García committed
24
  script:
25 26
    - yarn lint
  allow_failure: true
Eduardo Sanz García's avatar
Eduardo Sanz García committed
27 28 29

test:
  stage: test
30
  image: esanzgar/node-chromium
31
  tags: [docker]
Eduardo Sanz García's avatar
Eduardo Sanz García committed
32
  script:
33
    - yarn test:sr:chromium
Eduardo Sanz García's avatar
Eduardo Sanz García committed
34 35 36 37
  artifacts:
    paths:
      - coverage/

38 39
build:
  stage: build
40
  image: node:alpine
41
  tags: [docker]
42
  script:
43
    - yarn packagr
44
  artifacts:
45
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
46
    paths:
47 48 49
      - dist-lib/
  only:
    - master
50

51 52
pages:
  stage: docs
53
  image: node:alpine
54
  tags: [docker]
Eduardo Sanz García's avatar
Eduardo Sanz García committed
55
  script:
56 57 58
    - yarn docs
    - mkdir public
    - cp -r docs/* public/
Eduardo Sanz García's avatar
Eduardo Sanz García committed
59 60
  artifacts:
    paths:
61
      - public
Eduardo Sanz García's avatar
Eduardo Sanz García committed
62 63
  only:
    - master