ci.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: Tests
  2. on: [push, pull_request]
  3. jobs:
  4. unit_tests:
  5. name: Unit tests
  6. runs-on: ubuntu-latest
  7. strategy:
  8. matrix:
  9. node-version: [12.x, 14.x, 16.x]
  10. steps:
  11. - name: Checkout sources
  12. uses: actions/checkout@v2
  13. - name: Install Node.js
  14. uses: actions/setup-node@v2-beta
  15. with:
  16. node-version: ${{matrix.node-version}}
  17. - name: Install npm 7
  18. run: npm install --global npm@7
  19. - name: Install dependencies
  20. run: npm ci
  21. - name: Run tests
  22. run: npm run test:unit
  23. lint_js:
  24. name: Lint JavaScript
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Checkout sources
  28. uses: actions/checkout@v2
  29. - name: Install Node.js
  30. uses: actions/setup-node@v2-beta
  31. with:
  32. node-version: 14.x
  33. - name: Install npm 7
  34. run: npm install --global npm@7
  35. - name: Install dependencies
  36. run: npm ci
  37. - name: Run linter
  38. run: npm run lint
  39. lint_md:
  40. name: Lint Markdown
  41. runs-on: ubuntu-latest
  42. steps:
  43. - name: Checkout sources
  44. uses: actions/checkout@v2
  45. - name: Install Node.js
  46. uses: actions/setup-node@v2-beta
  47. with:
  48. node-version: 14.x
  49. - name: Install npm 7
  50. run: npm install --global npm@7
  51. - name: Install dependencies
  52. run: npm ci
  53. - name: Run linter
  54. run: npm run lint:markdown
  55. types:
  56. name: Type tests
  57. runs-on: ubuntu-latest
  58. steps:
  59. - name: Checkout sources
  60. uses: actions/checkout@v2
  61. - name: Install Node.js
  62. uses: actions/setup-node@v2-beta
  63. with:
  64. node-version: 16.x
  65. - name: Install npm 7
  66. run: npm install --global npm@7
  67. - name: Install dependencies
  68. run: npm ci
  69. - name: Run type tests
  70. run: npm run lint:markdown
  71. # Need to do a bunch of work to generate the locale typings 🙃
  72. - name: Prepare type declarations
  73. run: |
  74. npm run build:lib
  75. npm run build:companion
  76. npm run build:locale-pack
  77. - name: Run type tests
  78. run: npm run test:type