test_suite.yml 3.8 KB

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