1
0

node-tests.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. name: Node tests
  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@v3
  18. - name: Read package.json node and npm engines version
  19. uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1
  20. id: versions
  21. with:
  22. fallbackNode: '^16'
  23. fallbackNpm: '^7'
  24. test:
  25. runs-on: ubuntu-latest
  26. needs: versions
  27. steps:
  28. - name: Checkout
  29. uses: actions/checkout@v3
  30. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  31. uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
  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 and process coverage
  39. run: npm run test:coverage
  40. - name: Collect coverage
  41. uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
  42. with:
  43. files: ./coverage/lcov.info
  44. jsunit:
  45. runs-on: ubuntu-latest
  46. needs: versions
  47. steps:
  48. - name: Checkout
  49. uses: actions/checkout@v3
  50. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  51. uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
  52. with:
  53. node-version: ${{ needs.versions.outputs.nodeVersion }}
  54. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  55. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  56. - name: Install dependencies
  57. run: npm ci
  58. - name: Test
  59. run: npm run test:jsunit
  60. handlebars:
  61. runs-on: ubuntu-latest
  62. needs: versions
  63. steps:
  64. - name: Checkout
  65. uses: actions/checkout@v3
  66. - name: Set up node ${{ needs.versions.outputs.nodeVersion }}
  67. uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
  68. with:
  69. node-version: ${{ needs.versions.outputs.nodeVersion }}
  70. - name: Set up npm ${{ needs.versions.outputs.npmVersion }}
  71. run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}"
  72. - name: Install dependencies
  73. run: npm ci
  74. - name: Run compile
  75. run: ./build/compile-handlebars-templates.sh