You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
7.9KB

  1. variables:
  2. YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
  3. jobs:
  4. - job: basic
  5. pool:
  6. vmImage: ubuntu-latest
  7. steps:
  8. - task: NodeTool@0
  9. inputs:
  10. versionSpec: "^12.4.0"
  11. displayName: "Install Node.js"
  12. - script: |
  13. curl -o- -L https://yarnpkg.com/install.sh | bash
  14. displayName: "Install Yarn"
  15. - script: |
  16. set -e
  17. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  18. node -v
  19. yarn -v
  20. displayName: "Print versions"
  21. - task: CacheBeta@1
  22. inputs:
  23. key: yarn | $(Agent.OS) | yarn.lock
  24. path: $(YARN_CACHE_FOLDER)
  25. displayName: "Cache Yarn packages"
  26. - script: |
  27. set -e
  28. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  29. yarn --frozen-lockfile
  30. yarn link --frozen-lockfile || true
  31. yarn link webpack --frozen-lockfile
  32. displayName: "Install dependencies"
  33. - script: |
  34. set -e
  35. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  36. export JEST_JUNIT_OUTPUT=./basic-junit.xml
  37. yarn test:basic --ci --reporters=jest-junit
  38. export JEST_JUNIT_OUTPUT=./unit-junit.xml
  39. yarn test:unit --ci --reporters=jest-junit
  40. displayName: "Run basic tests"
  41. - task: PublishTestResults@2
  42. inputs:
  43. testRunTitle: "basic"
  44. testResultsFiles: "**/basic-junit.xml"
  45. condition: succeededOrFailed()
  46. displayName: "Publish basic test results"
  47. - task: PublishTestResults@2
  48. inputs:
  49. testRunTitle: "unit"
  50. testResultsFiles: "**/unit-junit.xml"
  51. condition: succeededOrFailed()
  52. displayName: "Publish unit test results"
  53. - job: lint
  54. pool:
  55. vmImage: ubuntu-latest
  56. steps:
  57. - task: NodeTool@0
  58. inputs:
  59. versionSpec: "^12.4.0"
  60. displayName: "Install Node.js"
  61. - script: |
  62. curl -o- -L https://yarnpkg.com/install.sh | bash
  63. displayName: "Install Yarn"
  64. - script: |
  65. set -e
  66. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  67. node -v
  68. yarn -v
  69. displayName: "Print versions"
  70. - task: CacheBeta@1
  71. inputs:
  72. key: yarn | $(Agent.OS) | yarn.lock
  73. path: $(YARN_CACHE_FOLDER)
  74. displayName: "Cache Yarn packages"
  75. - script: |
  76. set -e
  77. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  78. yarn --frozen-lockfile
  79. yarn link --frozen-lockfile || true
  80. yarn link webpack --frozen-lockfile
  81. displayName: "Install dependencies"
  82. - script: |
  83. set -e
  84. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  85. yarn -s run code-lint --format junit > junit.xml
  86. yarn jest-lint
  87. yarn type-lint
  88. yarn special-lint
  89. displayName: "Run linting"
  90. - task: PublishTestResults@2
  91. inputs:
  92. testRunTitle: "lint"
  93. testResultsFiles: "**/junit.xml"
  94. condition: succeededOrFailed()
  95. displayName: "Publish lint results"
  96. - job: Linux
  97. dependsOn:
  98. - basic
  99. - lint
  100. pool:
  101. vmImage: ubuntu-latest
  102. strategy:
  103. maxParallel: 3
  104. matrix:
  105. node-13:
  106. node_version: ^13.0.0
  107. node-12:
  108. node_version: ^12.4.0
  109. node-10:
  110. node_version: ^10.13.0
  111. steps:
  112. - task: NodeTool@0
  113. inputs:
  114. versionSpec: $(node_version)
  115. displayName: "Install Node.js $(node_version)"
  116. - script: |
  117. curl -o- -L https://yarnpkg.com/install.sh | bash
  118. displayName: "Install Yarn"
  119. - script: |
  120. set -e
  121. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  122. node -v
  123. yarn -v
  124. displayName: "Print versions"
  125. - task: CacheBeta@1
  126. inputs:
  127. key: yarn | $(Agent.OS) | yarn.lock
  128. path: $(YARN_CACHE_FOLDER)
  129. displayName: "Cache Yarn packages"
  130. - script: |
  131. set -e
  132. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  133. yarn --frozen-lockfile
  134. yarn link --frozen-lockfile || true
  135. yarn link webpack --frozen-lockfile
  136. displayName: "Install dependencies"
  137. - script: |
  138. set -e
  139. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  140. yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
  141. displayName: "Run tests with coverage"
  142. - task: PublishTestResults@2
  143. inputs:
  144. testRunTitle: "Linux with Node.js $(node_version)"
  145. testResultsFiles: "**/junit.xml"
  146. condition: succeededOrFailed()
  147. displayName: "Publish test results"
  148. - job: macOS
  149. dependsOn:
  150. - basic
  151. - lint
  152. pool:
  153. vmImage: macOS-latest
  154. strategy:
  155. maxParallel: 3
  156. matrix:
  157. node-13:
  158. node_version: ^13.0.0
  159. node-12:
  160. node_version: ^12.4.0
  161. node-10:
  162. node_version: ^10.13.0
  163. steps:
  164. - task: NodeTool@0
  165. inputs:
  166. versionSpec: $(node_version)
  167. displayName: "Install Node.js $(node_version)"
  168. - script: |
  169. curl -o- -L https://yarnpkg.com/install.sh | bash
  170. displayName: "Install Yarn"
  171. - script: |
  172. set -e
  173. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  174. node -v
  175. yarn -v
  176. displayName: "Print versions"
  177. - task: CacheBeta@1
  178. inputs:
  179. key: yarn | $(Agent.OS) | yarn.lock
  180. path: $(YARN_CACHE_FOLDER)
  181. displayName: "Cache Yarn packages"
  182. - script: |
  183. set -e
  184. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  185. yarn --frozen-lockfile
  186. yarn link --frozen-lockfile || true
  187. yarn link webpack --frozen-lockfile
  188. displayName: "Install dependencies"
  189. - script: |
  190. set -e
  191. export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
  192. yarn cover:integration --ci --reporters=jest-junit
  193. displayName: "Run tests with coverage"
  194. - task: PublishTestResults@2
  195. inputs:
  196. testRunTitle: "macOS with Node.js $(node_version)"
  197. testResultsFiles: "**/junit.xml"
  198. condition: succeededOrFailed()
  199. displayName: "Publish test results"
  200. - job: Windows
  201. dependsOn:
  202. - basic
  203. - lint
  204. pool:
  205. vmImage: windows-latest
  206. strategy:
  207. maxParallel: 3
  208. matrix:
  209. node-13:
  210. node_version: ^13.0.0
  211. node-12:
  212. node_version: ^12.4.0
  213. node-10:
  214. node_version: ^10.13.0
  215. steps:
  216. - task: NodeTool@0
  217. inputs:
  218. versionSpec: $(node_version)
  219. displayName: "Install Node.js $(node_version)"
  220. - script: |
  221. npm install --global yarn
  222. displayName: "Install Yarn"
  223. - script: |
  224. node -v
  225. yarn -v
  226. displayName: "Print versions"
  227. - task: CacheBeta@1
  228. inputs:
  229. key: yarn | $(Agent.OS) | yarn.lock
  230. path: $(YARN_CACHE_FOLDER)
  231. displayName: "Cache Yarn packages"
  232. - script: |
  233. yarn --frozen-lockfile
  234. yarn link --frozen-lockfile || true
  235. yarn link webpack --frozen-lockfile
  236. displayName: "Install dependencies"
  237. - script: |
  238. yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
  239. displayName: "Run tests with coverage"
  240. - task: PublishTestResults@2
  241. inputs:
  242. testRunTitle: "Windows with Node.js $(node_version)"
  243. testResultsFiles: "**/junit.xml"
  244. condition: succeededOrFailed()
  245. displayName: "Publish test results"