build.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #
  2. # Copyright 2018-2022 Elyra Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. name: Validate
  17. on: [push, pull_request]
  18. env:
  19. FORCE_COLOR: true
  20. jobs:
  21. prepare-yarn-cache:
  22. name: Prepare Cache
  23. runs-on: ubuntu-latest
  24. steps:
  25. - uses: actions/checkout@v2
  26. - uses: actions/setup-node@v2
  27. with:
  28. node-version: "*"
  29. - uses: actions/cache@v2
  30. with:
  31. path: |
  32. node_modules
  33. */*/node_modules
  34. /home/runner/.cache/Cypress
  35. key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
  36. - name: Install
  37. run: yarn install --frozen-lockfile
  38. lint:
  39. name: Lint
  40. needs: prepare-yarn-cache
  41. runs-on: ubuntu-latest
  42. steps:
  43. - uses: actions/checkout@v2
  44. - uses: actions/setup-node@v2
  45. with:
  46. node-version: "*"
  47. - uses: actions/cache@v2
  48. with:
  49. path: |
  50. node_modules
  51. */*/node_modules
  52. key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
  53. - name: Install
  54. run: yarn install
  55. - name: Lint
  56. run: yarn lint
  57. - name: Check format
  58. run: yarn format:check
  59. test-coverage:
  60. name: Generate Coverage Report
  61. needs: prepare-yarn-cache
  62. runs-on: ubuntu-latest
  63. steps:
  64. - uses: actions/checkout@v2
  65. - uses: actions/setup-node@v2
  66. with:
  67. node-version: "*"
  68. - uses: actions/cache@v2
  69. with:
  70. path: |
  71. node_modules
  72. */*/node_modules
  73. key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
  74. - name: Install
  75. run: yarn install
  76. - name: Build
  77. run: yarn build
  78. - name: Generate coverage report
  79. run: yarn test:cover
  80. - name: Upload coverage report
  81. uses: codecov/codecov-action@v1
  82. test:
  83. name: Test
  84. needs: prepare-yarn-cache
  85. runs-on: ubuntu-latest
  86. strategy:
  87. matrix:
  88. node-version: [15, 14, 12]
  89. steps:
  90. - uses: actions/checkout@v2
  91. - uses: actions/setup-node@v2 # Install dependencies with latest node version
  92. with:
  93. node-version: "*"
  94. - uses: actions/cache@v2
  95. with:
  96. path: |
  97. node_modules
  98. */*/node_modules
  99. key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
  100. - name: Install
  101. run: yarn install
  102. - uses: actions/setup-node@v2
  103. with:
  104. node-version: ${{ matrix.node-version }}
  105. - name: Build
  106. run: yarn build
  107. - name: Test
  108. run: yarn test
  109. test-integration:
  110. name: Run Integration Tests
  111. needs: prepare-yarn-cache
  112. runs-on: ubuntu-latest
  113. steps:
  114. - uses: actions/checkout@v2
  115. - uses: actions/setup-node@v2
  116. with:
  117. node-version: "*"
  118. - uses: actions/cache@v2
  119. with:
  120. path: |
  121. node_modules
  122. */*/node_modules
  123. /home/runner/.cache/Cypress
  124. key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
  125. - name: Install
  126. run: yarn install
  127. - name: Build
  128. run: yarn build
  129. - name: Cypress
  130. run: yarn test:cypress