nightly-no-cache.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. name: Nightly build without cache
  2. on:
  3. schedule:
  4. # strange schedule to reduce the risk of DDOS GitHub infra
  5. - cron: "48 4 * * *"
  6. workflow_dispatch:
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2.3.4
  12. with:
  13. fetch-depth: 0
  14. - name: Set up JDK 11 for running Gradle
  15. uses: actions/setup-java@v2
  16. with:
  17. distribution: adopt
  18. java-version: 11
  19. - name: Cache Gradle Wrapper
  20. uses: actions/cache@v2
  21. with:
  22. path: ~/.gradle/wrapper
  23. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
  24. - name: Build
  25. run: ./gradlew build --no-build-cache
  26. build-gradle-plugins:
  27. runs-on: ubuntu-latest
  28. steps:
  29. - uses: actions/checkout@v2.3.4
  30. with:
  31. fetch-depth: 0
  32. - name: Set up JDK 11 for running Gradle
  33. uses: actions/setup-java@v2
  34. with:
  35. distribution: adopt
  36. java-version: 11
  37. - name: Cache Gradle Wrapper
  38. uses: actions/cache@v2
  39. with:
  40. path: ~/.gradle/wrapper
  41. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
  42. - name: Build
  43. run: ../gradlew build --no-build-cache
  44. working-directory: gradle-plugins
  45. test:
  46. runs-on: ubuntu-latest
  47. strategy:
  48. matrix:
  49. test-java-version:
  50. - 8
  51. - 11
  52. - 15
  53. vm:
  54. - hotspot
  55. - openj9
  56. fail-fast: false
  57. steps:
  58. - uses: actions/checkout@v2.3.4
  59. with:
  60. fetch-depth: 0
  61. - id: setup-test-java
  62. name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
  63. uses: actions/setup-java@v2
  64. with:
  65. distribution: adopt-${{ matrix.vm }}
  66. java-version: ${{ matrix.test-java-version }}
  67. - name: Set up JDK 11 for running Gradle
  68. uses: actions/setup-java@v2
  69. with:
  70. distribution: adopt
  71. java-version: 11
  72. - name: Cache Gradle Wrapper
  73. uses: actions/cache@v2
  74. with:
  75. path: ~/.gradle/wrapper
  76. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
  77. - name: Test
  78. run: ./gradlew test -PtestJavaVersion=${{ matrix.test-java-version }} -PtestJavaVM=${{ matrix.vm }} -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false --no-build-cache
  79. testLatestDeps:
  80. runs-on: ubuntu-latest
  81. steps:
  82. - uses: actions/checkout@v2.3.4
  83. with:
  84. fetch-depth: 0
  85. - name: Set up JDK 11 for running Gradle
  86. uses: actions/setup-java@v2
  87. with:
  88. distribution: adopt
  89. java-version: 11
  90. - name: Cache Gradle Wrapper
  91. uses: actions/cache@v2
  92. with:
  93. path: ~/.gradle/wrapper
  94. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
  95. - name: Test
  96. run: ./gradlew test -PtestLatestDeps=true --no-build-cache
  97. smoke-test:
  98. runs-on: ${{ matrix.os }}
  99. strategy:
  100. matrix:
  101. os:
  102. - windows-latest
  103. - ubuntu-latest
  104. smoke-test-suite:
  105. - jetty
  106. - liberty
  107. - payara
  108. - tomcat
  109. - tomee
  110. - websphere
  111. - wildfly
  112. - other
  113. exclude:
  114. - os: windows-latest
  115. smoke-test-suite: websphere
  116. fail-fast: false
  117. steps:
  118. - name: Support longpaths
  119. run: git config --system core.longpaths true
  120. if: matrix.os == 'windows-latest'
  121. - uses: actions/checkout@v2.3.4
  122. with:
  123. fetch-depth: 0
  124. - name: Set up JDK 11 for running Gradle
  125. uses: actions/setup-java@v2
  126. with:
  127. distribution: adopt
  128. java-version: 11
  129. - name: Cache Gradle Wrapper
  130. uses: actions/cache@v2
  131. with:
  132. path: ~/.gradle/wrapper
  133. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
  134. - name: Test
  135. run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }} --no-build-cache
  136. # muzzle is intentionally not included in the nightly-no-cache build because
  137. # it doesn't use gradle cache anyways and so is already covered by the normal nightly build
  138. examples:
  139. runs-on: ubuntu-latest
  140. steps:
  141. - uses: actions/checkout@v2.3.4
  142. with:
  143. fetch-depth: 0
  144. - name: Set up JDK 11 for running Gradle
  145. uses: actions/setup-java@v2
  146. with:
  147. distribution: adopt
  148. java-version: 11
  149. - name: Cache Gradle Wrapper
  150. uses: actions/cache@v2
  151. with:
  152. path: ~/.gradle/wrapper
  153. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }}
  154. - name: Local publish of artifacts
  155. # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
  156. run: ./gradlew publishToMavenLocal -x javadoc
  157. - name: Local publish of gradle plugins
  158. # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
  159. run: ../gradlew publishToMavenLocal -x javadoc
  160. working-directory: gradle-plugins
  161. - name: Build distro
  162. run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
  163. working-directory: examples/distro
  164. - name: Build extension
  165. run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
  166. working-directory: examples/extension
  167. - name: Run muzzle check against extension
  168. run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
  169. working-directory: examples/extension
  170. issue:
  171. name: Open issue on failure
  172. needs: [ build, test, testLatestDeps, smoke-test, examples ]
  173. runs-on: ubuntu-latest
  174. if: always()
  175. steps:
  176. # run this action to get workflow conclusion
  177. # You can get conclusion by env (env.WORKFLOW_CONCLUSION)
  178. - uses: technote-space/workflow-conclusion-action@v2.2
  179. - uses: actions/checkout@v2.3.4
  180. with:
  181. fetch-depth: 0
  182. - uses: JasonEtco/create-an-issue@v2.6
  183. if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
  184. env:
  185. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  186. with:
  187. filename: .github/templates/workflow-failed.md