config.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. version: 2
  2. references:
  3. test-steps: &test-steps
  4. - checkout
  5. - restore_cache:
  6. keys:
  7. - v2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "package.json" }}
  8. - run: npm install
  9. - run: npm run build
  10. - run: npm run ${BUILDTARGET}
  11. - run: npm run ${TESTTARGET}
  12. - save_cache:
  13. key: v2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "package.json" }}
  14. paths:
  15. - node_modules
  16. jobs:
  17. unittest-node8:
  18. docker:
  19. - image: circleci/node:8-browsers
  20. steps: *test-steps
  21. environment:
  22. BUILDTARGET: build:unittests
  23. TESTTARGET: test:unit
  24. unittest-node10:
  25. docker:
  26. - image: circleci/node:10-browsers
  27. steps: *test-steps
  28. environment:
  29. BUILDTARGET: build:unittests
  30. TESTTARGET: test:unit
  31. uitest-firefox:
  32. docker:
  33. - image: circleci/node:10-browsers
  34. steps: *test-steps
  35. environment:
  36. BUILDTARGET: build:uitests
  37. TESTTARGET: test:ui firefox
  38. uitest-chrome:
  39. docker:
  40. - image: circleci/node:10-browsers
  41. steps: *test-steps
  42. environment:
  43. BUILDTARGET: build:uitests
  44. TESTTARGET: test:ui chrome
  45. dist:
  46. docker:
  47. - image: circleci/node:10-browsers
  48. steps:
  49. - checkout
  50. - restore_cache:
  51. keys:
  52. - v2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "package.json" }}
  53. - run: npm install --release
  54. - run: npm run dist
  55. - save_cache:
  56. key: v2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "package.json" }}
  57. paths:
  58. - node_modules
  59. docker-build:
  60. docker:
  61. - image: docker:stable
  62. steps:
  63. - checkout
  64. - setup_remote_docker
  65. - run: docker build . --no-cache -t threema/threema-web:${CIRCLE_BRANCH}
  66. lint:
  67. docker:
  68. - image: circleci/node:8-browsers
  69. steps:
  70. - checkout
  71. - restore_cache:
  72. keys:
  73. - v2-dependencies-test-node8-{{ arch }}-{{ checksum "package.json" }}
  74. - run: npm install
  75. - run: npm run lint
  76. workflows:
  77. version: 2
  78. build:
  79. jobs:
  80. - unittest-node8
  81. - unittest-node10
  82. - uitest-firefox
  83. - uitest-chrome
  84. - dist
  85. - lint
  86. - docker-build