.gitlab-ci.yml 913 Bytes
Newer Older
Eduardo Sanz García's avatar
Eduardo Sanz García committed
1 2 3 4 5 6 7 8 9 10 11 12 13
stages:
  - prepare
  - test
  - build

# Needed to launch the image
variables:
  USER_ID: "$(id -u)"
  GROUP_ID: "$(id -g)"

prepare:
  stage: prepare
  image: node:alpine
14
  tags: [docker]
Eduardo Sanz García's avatar
Eduardo Sanz García committed
15 16
  script:
    - yarn
17
    - yarn ng --version # Display version information
Eduardo Sanz García's avatar
Eduardo Sanz García committed
18 19 20 21 22 23 24
  artifacts:
    paths:
      - node_modules/
    expire_in: 1 hour

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

lint:
  stage: test
  image: node:alpine
36
  tags: [docker]
Eduardo Sanz García's avatar
Eduardo Sanz García committed
37 38 39 40
  script:
    - yarn lint
  allow_failure: true

Eduardo Sanz García's avatar
Eduardo Sanz García committed
41
docs:
42 43
  stage: test
  image: node:alpine
44
  tags: [docker]
45 46 47 48 49 50
  script:
    - yarn docs
  artifacts:
    paths:
      - docs/

Eduardo Sanz García's avatar
Eduardo Sanz García committed
51 52 53
build:
  stage: build
  image: node:alpine
54
  tags: [docker]
Eduardo Sanz García's avatar
Eduardo Sanz García committed
55
  script:
56
    - yarn build
Eduardo Sanz García's avatar
Eduardo Sanz García committed
57 58 59 60 61 62
  artifacts:
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    paths:
      - dist-lib/
  only:
    - master