styleguide-tests:
  extends: .rules
  stage: test
  image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:22
  coverage: /Lines\s* [:] ([\d\.]+)%/
  script:
    - npm ci
    - npm run test:ci:coverage
  artifacts:
    when: always
    reports:
      junit:
        - junit.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml

linter:
  stage: test
  image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:22
  extends: .rules
  script:
    - npm install
    - npm run lint

storybook:
  stage: test
  extends: .rules
  image: mcr.microsoft.com/playwright:v1.59.0.
  script:
    - npm install
    - npm run dev:storybook:install
    - npm run dev:storybook:build
    - |
      npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
        "npx http-server storybook-static --port 6006 --silent" \
        "npx wait-on tcp:6006 && npm run test:storybook"

audit:
  allow_failure: true
  extends: .rules
  stage: test
  image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:22
  script:
    - npm audit
