backend.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. name: Backend
  18. on:
  19. push:
  20. branches:
  21. - dev
  22. paths:
  23. - '.github/workflows/backend.yml'
  24. - 'package.xml'
  25. - 'pom.xml'
  26. - 'dolphinscheduler-alert/**'
  27. - 'dolphinscheduler-api/**'
  28. - 'dolphinscheduler-common/**'
  29. - 'dolphinscheduler-dao/**'
  30. - 'dolphinscheduler-rpc/**'
  31. - 'dolphinscheduler-server/**'
  32. pull_request:
  33. concurrency:
  34. group: backend-${{ github.event.pull_request.number || github.ref }}
  35. cancel-in-progress: true
  36. jobs:
  37. paths-filter:
  38. name: Backend-Path-Filter
  39. runs-on: ubuntu-latest
  40. outputs:
  41. not-ignore: ${{ steps.filter.outputs.not-ignore }}
  42. steps:
  43. - uses: actions/checkout@v2
  44. - uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
  45. id: filter
  46. with:
  47. filters: |
  48. not-ignore:
  49. - '!(docs/**)'
  50. build:
  51. name: Backend-Build
  52. needs: paths-filter
  53. if: ${{ (needs.paths-filter.outputs.not-ignore == 'true') || (github.event_name == 'push') }}
  54. runs-on: ubuntu-latest
  55. strategy:
  56. matrix:
  57. java: [ '8', '11' ]
  58. timeout-minutes: 30
  59. steps:
  60. - uses: actions/checkout@v2
  61. with:
  62. submodules: true
  63. - name: Set up JDK ${{ matrix.java }}
  64. uses: actions/setup-java@v2
  65. with:
  66. java-version: ${{ matrix.java }}
  67. distribution: 'adopt'
  68. - name: Sanity Check
  69. uses: ./.github/actions/sanity-check
  70. - uses: actions/cache@v3
  71. with:
  72. path: ~/.m2/repository
  73. key: ${{ runner.os }}-maven
  74. - name: Build and Package on ${{ matrix.java }}
  75. run: |
  76. ./mvnw -B clean install \
  77. -Prelease,docker \
  78. -Dmaven.test.skip=true \
  79. -Dcheckstyle.skip=true \
  80. -Dhttp.keepAlive=false \
  81. -Dmaven.wagon.http.pool=false \
  82. -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
  83. - name: Check dependency license
  84. run: tools/dependencies/check-LICENSE.sh
  85. - uses: actions/upload-artifact@v2
  86. if: ${{ matrix.java == '8' }}
  87. name: Upload Binary Package
  88. with:
  89. name: binary-package-${{ matrix.java }}
  90. path: ./dolphinscheduler-dist/target/apache-dolphinscheduler-dev-SNAPSHOT-bin.tar.gz
  91. retention-days: 1
  92. cluster-test:
  93. name: ${{ matrix.case.name }}
  94. needs: build
  95. runs-on: ubuntu-latest
  96. timeout-minutes: 20
  97. strategy:
  98. matrix:
  99. case:
  100. - name: cluster-test-mysql
  101. script: .github/workflows/cluster-test/mysql/start-job.sh
  102. - name: cluster-test-postgresql
  103. script: .github/workflows/cluster-test/postgresql/start-job.sh
  104. steps:
  105. - uses: actions/checkout@v2
  106. with:
  107. submodules: true
  108. - uses: actions/download-artifact@v2
  109. name: Download Binary Package
  110. with:
  111. # Only run cluster test on jdk8
  112. name: binary-package-8
  113. path: ./
  114. - name: Running cluster test
  115. run: |
  116. /bin/bash ${{ matrix.case.script }}
  117. result:
  118. name: Build
  119. runs-on: ubuntu-latest
  120. timeout-minutes: 30
  121. needs: [ build, paths-filter, cluster-test ]
  122. if: always()
  123. steps:
  124. - name: Status
  125. run: |
  126. if [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' && ${{ github.event_name }} == 'pull_request' ]]; then
  127. echo "Skip Build!"
  128. exit 0
  129. fi
  130. if [[ ${{ needs.build.result }} != 'success' || ${{ needs.cluster-test.result }} != 'success' ]]; then
  131. echo "Build Failed!"
  132. exit -1
  133. fi