image: node:10

stages:
  - install
  - build
  - quality

install:
  stage: install
  script:
    - cd client
    - npm install
  artifacts:
    name: "artifacts"
    untracked: true
    expire_in: 60 mins
    paths:
      - client/.npm/
      - client/node_modules/

build:
  stage: build
  script:
    - cd client
    - CI=false npm run build
  artifacts:
    paths:
      - client/build
    expire_in: 60 mins
  dependencies:
    - install

linting:
  stage: quality
  script:
    - cd client
    - npm run lint
  dependencies:
    - install

test:unit:
  stage: quality
  script:
    - cd client
    - npm run test:coverage
  dependencies:
    - install
  coverage: /All\sfiles.*?\s+(\d+.\d+)/
 
