frontend.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .template_vitest_shard:
  2. stage: test
  3. extends:
  4. - .job_rules_default
  5. cache: !reference [.cache, read_only_nodejs]
  6. before_script:
  7. - !reference [.scripts, pnpm_install]
  8. script:
  9. # Only run one worker to avoid load peaks affecting other jobs.
  10. - pnpm test -- --min-workers=1 --max-workers=1 --shard $VITEST_SHARD
  11. # Stop here, except on the first shard.
  12. - "[[ $VITEST_SHARD = 1/* ]] || exit 0"
  13. - echo "Also test eslint-plugin-zammad…"
  14. - cd .eslint-plugin-zammad
  15. - pnpm install || pnpm install || pnpm install # retry on errors
  16. - pnpm test
  17. frontend:vitest:1:
  18. extends:
  19. - .template_vitest_shard
  20. variables:
  21. VITEST_SHARD: 1/3
  22. frontend:vitest:2:
  23. extends:
  24. - .template_vitest_shard
  25. variables:
  26. VITEST_SHARD: 2/3
  27. frontend:vitest:3:
  28. extends:
  29. - .template_vitest_shard
  30. variables:
  31. VITEST_SHARD: 3/3
  32. frontend:cypress:
  33. stage: test
  34. extends:
  35. - .job_rules_default
  36. - .tags_docker_low_concurrency
  37. cache: !reference [.cache, read_only_nodejs]
  38. before_script:
  39. - !reference [.scripts, pnpm_install]
  40. - pnpm cypress:install
  41. script:
  42. - sysctl -w fs.inotify.max_user_watches=524288 # see https://github.com/cypress-io/cypress/issues/6960
  43. - pnpm test:ci:ct
  44. artifacts:
  45. expire_in: 1 week
  46. when: on_failure
  47. paths:
  48. - app/frontend/cypress/**/__image_snapshots__/**/*
  49. - .dev/cypress/**/__diff_output__/*
  50. - .dev/cypress/videos/**/*
  51. - .dev/cypress/screenshots/**/*