node-tests.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: Node
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - master
  7. - stable*
  8. jobs:
  9. versions:
  10. runs-on: ubuntu-latest
  11. outputs:
  12. nodeVersion: ${{ steps.versions.outputs.nodeVersion }}
  13. npmVersion: ${{ steps.versions.outputs.npmVersion }}
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v2
  17. - name: Read package.json node and npm engines version
  18. uses: skjnldsv/read-package-engines-version-actions@v1.1
  19. id: versions
  20. with:
  21. fallbackNode: '^12'
  22. fallbackNpm: '^6'
  23. test:
  24. runs-on: ubuntu-latest
  25. needs: versions
  26. steps:
  27. - name: Checkout
  28. uses: actions/checkout@v2
  29. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  30. uses: actions/setup-node@v2
  31. with:
  32. node-version: ${{ needs.versions.outputs.nodeVersion }}
  33. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  34. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  35. - name: Install dependencies
  36. run: npm ci
  37. - name: Test
  38. run: npm run test
  39. jsunit:
  40. runs-on: ubuntu-latest
  41. needs: versions
  42. steps:
  43. - name: Checkout
  44. uses: actions/checkout@v2
  45. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  46. uses: actions/setup-node@v2
  47. with:
  48. node-version: ${{ needs.versions.outputs.nodeVersion }}
  49. # This test requires npm6 for some reason
  50. # TODO: fix this and/or move away from jsunit
  51. - name: Set up npm 6
  52. run: npm i -g npm@^6
  53. - name: Test
  54. run: ./autotest-js.sh
  55. handlebars:
  56. runs-on: ubuntu-latest
  57. needs: versions
  58. steps:
  59. - name: Checkout
  60. uses: actions/checkout@v2
  61. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  62. uses: actions/setup-node@v2
  63. with:
  64. node-version: ${{ needs.versions.outputs.nodeVersion }}
  65. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  66. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  67. - name: Install dependencies
  68. run: npm ci
  69. - name: Run compile
  70. run: ./build/compile-handlebars-templates.sh