image: node:20.17

stages:
  - npm
  - quality
  - unit_test

npm:
  stage: npm
  script:
    - npm install
  cache:
    paths:
      - node_modules/
  artifacts:
    expire_in: 2 hours
    when: on_success
    paths:
      - node_modules/

quality:
  stage: quality
  dependencies:
    - npm
  script:
    - npm run lint

unit_test:
  stage: unit_test
  dependencies:
    - npm
  script:
    - npm run test

