py-ci.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements. See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License. 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. name: Python API
  16. on:
  17. push:
  18. branches:
  19. - dev
  20. paths:
  21. - 'dolphinscheduler-python/**'
  22. pull_request:
  23. paths:
  24. - 'dolphinscheduler-python/**'
  25. concurrency:
  26. group: py-${{ github.event.pull_request.number || github.ref }}
  27. cancel-in-progress: true
  28. defaults:
  29. run:
  30. working-directory: dolphinscheduler-python/pydolphinscheduler
  31. # We have to update setuptools wheel to package with package_data, LICENSE, NOTICE
  32. env:
  33. DEPENDENCES: pip setuptools wheel tox
  34. jobs:
  35. lint:
  36. name: Lint
  37. runs-on: ubuntu-latest
  38. steps:
  39. - uses: actions/checkout@v2
  40. - name: Set up Python 3.7
  41. uses: actions/setup-python@v2
  42. with:
  43. python-version: 3.7
  44. - name: Install Dependences
  45. run: |
  46. python -m pip install --upgrade ${{ env.DEPENDENCES }}
  47. - name: Run All Lint Check
  48. run: |
  49. python -m tox -vv -e lint
  50. pytest:
  51. name: Pytest
  52. needs: lint
  53. runs-on: ${{ matrix.os }}
  54. strategy:
  55. fail-fast: false
  56. matrix:
  57. python-version: [3.6, 3.7, 3.8, 3.9]
  58. os: [ubuntu-18.04, macOS-latest, windows-latest]
  59. steps:
  60. - uses: actions/checkout@v2
  61. - name: Set up Python ${{ matrix.python-version }}
  62. uses: actions/setup-python@v2
  63. with:
  64. python-version: ${{ matrix.python-version }}
  65. - name: Install Dependences
  66. run: |
  67. python -m pip install --upgrade ${{ env.DEPENDENCES }}
  68. - name: Run All Tests
  69. run: |
  70. python -m tox -vv -e code-test
  71. doc-build:
  72. name: Docs Build Test
  73. needs: lint
  74. runs-on: ubuntu-latest
  75. steps:
  76. - uses: actions/checkout@v2
  77. - name: Set up Python 3.7
  78. uses: actions/setup-python@v2
  79. with:
  80. python-version: 3.7
  81. - name: Install Dependences
  82. run: |
  83. python -m pip install --upgrade ${{ env.DEPENDENCES }}
  84. - name: Run Tests Build Docs
  85. run: |
  86. python -m tox -vv -e doc-build-test
  87. verify-local-ci:
  88. name: Local CI
  89. needs:
  90. - pytest
  91. - doc-build
  92. runs-on: ubuntu-latest
  93. steps:
  94. - uses: actions/checkout@v2
  95. - name: Set up Python 3.7
  96. uses: actions/setup-python@v2
  97. with:
  98. python-version: 3.7
  99. - name: Install Dependences
  100. run: |
  101. python -m pip install --upgrade ${{ env.DEPENDENCES }}
  102. - name: Run Tests Build Docs
  103. run: |
  104. python -m tox -vv -e local-ci