node-tests.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  12. outputs:
  13. nodeVersion: ${{ steps.versions.outputs.nodeVersion }}
  14. npmVersion: ${{ steps.versions.outputs.npmVersion }}
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v2
  18. - name: Read package.json node and npm engines version
  19. uses: skjnldsv/read-package-engines-version-actions@v1.1
  20. id: versions
  21. with:
  22. fallbackNode: '^12'
  23. fallbackNpm: '^6'
  24. test:
  25. runs-on: ubuntu-latest
  26. needs: versions
  27. steps:
  28. - name: Checkout
  29. uses: actions/checkout@v2
  30. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  31. uses: actions/setup-node@v2
  32. with:
  33. node-version: ${{ needs.versions.outputs.nodeVersion }}
  34. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  35. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  36. - name: Install dependencies
  37. run: npm ci
  38. - name: Test
  39. run: npm run test
  40. jsunit:
  41. runs-on: ubuntu-latest
  42. needs: versions
  43. steps:
  44. - name: Checkout
  45. uses: actions/checkout@v2
  46. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  47. uses: actions/setup-node@v2
  48. with:
  49. node-version: ${{ needs.versions.outputs.nodeVersion }}
  50. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  51. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  52. - name: Install dependencies
  53. run: npm ci
  54. - name: Test
  55. run: ./autotest-js.sh
  56. handlebars:
  57. runs-on: ubuntu-latest
  58. needs: versions
  59. steps:
  60. - name: Checkout
  61. uses: actions/checkout@v2
  62. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  63. uses: actions/setup-node@v2
  64. with:
  65. node-version: ${{ needs.versions.outputs.nodeVersion }}
  66. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  67. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  68. - name: Install dependencies
  69. run: npm ci
  70. - name: Run compile
  71. run: ./build/compile-handlebars-templates.sh