.gitlab-ci.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # @see https://docs.cypress.io/guides/continuous-integration/gitlab-ci
  2. # Consult the results on the Cypress dashboard: https://dashboard.cypress.io/
  3. stages:
  4. - build
  5. - test
  6. ## Set environment variables for folders in "cache" job settings for npm modules and Cypress binary
  7. variables:
  8. npm_config_cache: '$CI_PROJECT_DIR/.npm'
  9. CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress'
  10. cache:
  11. key: ${CI_COMMIT_REF_SLUG}
  12. paths:
  13. - .cache/*
  14. - cache/Cypress
  15. - node_modules
  16. - build
  17. ## Install NPM dependencies and Cypress
  18. install:
  19. image: cypress/browsers:node14.17.0-chrome88-ff89
  20. stage: build
  21. script:
  22. - yarn install --dev
  23. - npx cypress cache path
  24. - npx cypress cache list
  25. chrome:
  26. image: cypress/browsers:node14.17.0-chrome88-ff89
  27. stage: test
  28. script:
  29. - yarn dev:ci & npx wait-on http://localhost:3004
  30. - yarn cypress:run --browser chrome
  31. artifacts:
  32. when: on_failure
  33. paths:
  34. - test/cypress/videos/**/*.mp4
  35. - test/cypress/screenshots/**/*.png
  36. expire_in: 3 day
  37. chrome-mobile:
  38. image: cypress/browsers:node14.17.0-chrome88-ff89
  39. stage: test
  40. script:
  41. - yarn dev:ci & npx wait-on http://localhost:3004
  42. - yarn cypress:run --browser chrome --config "viewportWidth=375,viewportHeight=667"
  43. artifacts:
  44. when: on_failure
  45. paths:
  46. - test/cypress/videos/**/*.mp4
  47. - test/cypress/screenshots/**/*.png
  48. expire_in: 3 day
  49. firefox:
  50. image: cypress/browsers:node14.17.0-chrome88-ff89
  51. stage: test
  52. script:
  53. - yarn dev:ci & npx wait-on http://localhost:3004
  54. - yarn cypress:run --browser firefox
  55. artifacts:
  56. when: on_failure
  57. paths:
  58. - test/cypress/videos/**/*.mp4
  59. - test/cypress/screenshots/**/*.png
  60. expire_in: 3 day
  61. firefox-mobile:
  62. image: cypress/browsers:node14.17.0-chrome88-ff89
  63. stage: test
  64. script:
  65. - yarn dev:ci & npx wait-on http://localhost:3004
  66. - yarn cypress:run --browser firefox --config "viewportWidth=375,viewportHeight=667"
  67. artifacts:
  68. when: on_failure
  69. paths:
  70. - test/cypress/videos/**/*.mp4
  71. - test/cypress/screenshots/**/*.png
  72. expire_in: 3 day