backend.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
  44. id: filter
  45. with:
  46. filters: |
  47. not-ignore:
  48. - '!(docs/**|dolphinscheduler-ui/**|dolphinscheduler-ui-next/**)'
  49. build:
  50. name: Backend-Build
  51. needs: paths-filter
  52. if: ${{ needs.paths-filter.outputs.not-ignore == 'true' }}
  53. runs-on: ubuntu-latest
  54. timeout-minutes: 30
  55. steps:
  56. - uses: actions/checkout@v2
  57. with:
  58. submodules: true
  59. - name: Sanity Check
  60. uses: ./.github/actions/sanity-check
  61. - uses: actions/cache@v2
  62. with:
  63. path: ~/.m2/repository
  64. key: ${{ runner.os }}-maven
  65. - name: Build and Package
  66. run: |
  67. ./mvnw -B clean install \
  68. -Prelease,docker \
  69. -Dmaven.test.skip=true \
  70. -Dcheckstyle.skip=true \
  71. -Dhttp.keepAlive=false \
  72. -Dmaven.wagon.http.pool=false \
  73. -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
  74. - name: Check dependency license
  75. run: tools/dependencies/check-LICENSE.sh
  76. result:
  77. name: Build
  78. runs-on: ubuntu-latest
  79. timeout-minutes: 30
  80. needs: [ build, paths-filter ]
  81. if: always()
  82. steps:
  83. - name: Status
  84. run: |
  85. if [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' ]]; then
  86. echo "Skip Build!"
  87. exit 0
  88. fi
  89. if [[ ${{ needs.build.result }} != 'success' ]]; then
  90. echo "Build Failed!"
  91. exit -1
  92. fi