test_suite.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. name: Test suite
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. jobs:
  8. # the following are optional jobs and need to be configured according
  9. # to this project's settings:
  10. #
  11. # lintcode:
  12. # name: Javascript lint
  13. # runs-on: ubuntu-latest
  14. # steps:
  15. # - name: checkout
  16. # uses: actions/checkout@v3
  17. #
  18. # - name: setup node
  19. # uses: actions/setup-node@v1
  20. # with:
  21. # node-version: '12.x'
  22. #
  23. # - name: cache dependencies
  24. # uses: actions/cache@v1
  25. # with:
  26. # path: ~/.npm
  27. # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  28. # restore-keys: |
  29. # ${{ runner.os }}-node-
  30. #
  31. # - run: npm install
  32. # - run: npm run lint:code
  33. #
  34. # lintstyle:
  35. # name: SCSS lint
  36. # runs-on: ubuntu-latest
  37. # needs: [lintcode]
  38. # steps:
  39. # - name: checkout
  40. # uses: actions/checkout@v3
  41. #
  42. # - name: setup node
  43. # uses: actions/setup-node@v1
  44. # with:
  45. # node-version: '12.x'
  46. #
  47. # - name: cache dependencies
  48. # uses: actions/cache@v1
  49. # with:
  50. # path: ~/.npm
  51. # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  52. # restore-keys: |
  53. # ${{ runner.os }}-node-
  54. # - run: npm install
  55. # - run: npm run lint:style
  56. #
  57. # lintdocs:
  58. # name: documentation lint
  59. # runs-on: ubuntu-latest
  60. # needs: [lintcode,lintstyle]
  61. # steps:
  62. # - name: checkout
  63. # uses: actions/checkout@v3
  64. #
  65. # - name: setup node
  66. # uses: actions/setup-node@v1
  67. # with:
  68. # node-version: '12.x'
  69. #
  70. # - name: cache dependencies
  71. # uses: actions/cache@v1
  72. # with:
  73. # path: ~/.npm
  74. # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  75. # restore-keys: |
  76. # ${{ runner.os }}-node-
  77. #
  78. # - run: npm install
  79. # - run: npm run lint:markdown
  80. tests:
  81. name: Meteor ${{ matrix.meteor }} tests
  82. runs-on: ubuntu-latest
  83. steps:
  84. # CHECKOUTS
  85. - name: Checkout
  86. uses: actions/checkout@v3
  87. # CACHING
  88. - name: Install Meteor
  89. id: cache-meteor-install
  90. uses: actions/cache@v3
  91. with:
  92. path: ~/.meteor
  93. key: v1-meteor-${{ hashFiles('.meteor/versions') }}
  94. restore-keys: |
  95. v1-meteor-
  96. - name: Cache NPM dependencies
  97. id: cache-meteor-npm
  98. uses: actions/cache@v3
  99. with:
  100. path: ~/.npm
  101. key: v1-npm-${{ hashFiles('package-lock.json') }}
  102. restore-keys: |
  103. v1-npm-
  104. - name: Cache Meteor build
  105. id: cache-meteor-build
  106. uses: actions/cache@v3
  107. with:
  108. path: |
  109. .meteor/local/resolver-result-cache.json
  110. .meteor/local/plugin-cache
  111. .meteor/local/isopacks
  112. .meteor/local/bundler-cache/scanner
  113. key: v1-meteor_build_cache-${{ github.ref }}-${{ github.sha }}
  114. restore-keys: |
  115. v1-meteor_build_cache-
  116. - name: Setup meteor
  117. uses: meteorengineer/setup-meteor@v1
  118. with:
  119. meteor-release: '2.2'
  120. - name: Install NPM Dependencies
  121. run: meteor npm ci
  122. - name: Run Tests
  123. run: sh ./test-wekan.sh -cv
  124. - name: Upload coverage
  125. uses: actions/upload-artifact@v2
  126. with:
  127. name: coverage-folder
  128. path: .coverage/
  129. coverage:
  130. name: Coverage report
  131. runs-on: ubuntu-latest
  132. needs: [tests]
  133. steps:
  134. - name: Checkout
  135. uses: actions/checkout@v3
  136. - name: Download coverage
  137. uses: actions/download-artifact@v2
  138. with:
  139. name: coverage-folder
  140. path: .coverage/
  141. - name: Coverage Report
  142. uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
  143. with:
  144. path: ".coverage/lcov.info"
  145. min_coverage: 1 # TODO add tests and increase to 95!