variables:
  CYPRESS_RECORD_KEY: $CYPRESS_RECORD_KEY

stages:
  - build
  - test

build-job:       # This job runs in the build stage, which runs first.
  stage: build
  image: node:latest
  script:
    - npm ci
    - npm run build
    - chmod u+x node_modules

unit-test-job:
  image: cypress/browsers:node16.16.0-chrome107-ff107-edge
  stage: test
  script:
    - npm ci
    - npm run test-component
  artifacts:
    when: always
    paths:
      - cypress/videos/**/*.mp4
      - cypress/screenshots/**/*.png
    expire_in: 1 day
