.gitlab-ci.yml 629 Bytes
Newer Older
NilsTesdal's avatar
NilsTesdal committed
1
2
3
stages:
  - test

NilsTesdal's avatar
NilsTesdal committed
4
5
6
7
8
variables:
  npm_config_cache: "$CI_PROJECT_DIR/.npm"
  CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"

# https://gitlab.com/help/ci/caching/index.md
NilsTesdal's avatar
NilsTesdal committed
9
10
11
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
NilsTesdal's avatar
NilsTesdal committed
12
13
14
    - .npm
    - cache/Cypress
    - node_modules
NilsTesdal's avatar
NilsTesdal committed
15
16

test:
NilsTesdal's avatar
NilsTesdal committed
17
  image: cypress/browsers:node12.14.1-chrome85-ff81
NilsTesdal's avatar
NilsTesdal committed
18
19
20
  stage: test
  script:
    # install dependencies
NilsTesdal's avatar
NilsTesdal committed
21
22
    - npm install

NilsTesdal's avatar
NilsTesdal committed
23
24
    # Kjør express-serveren i bakgrunnen
    - npm start &
NilsTesdal's avatar
NilsTesdal committed
25

NilsTesdal's avatar
NilsTesdal committed
26
    # run Cypress tests
NilsTesdal's avatar
NilsTesdal committed
27
    - npm test
NilsTesdal's avatar
NilsTesdal committed
28
29
30
31
32
33
  artifacts:
    when: always
    paths:
      - cypress/videos/**/*.mp4
      - cypress/screenshots/**/*.png
    expire_in: 1 day