py-ci.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. defaults:
  26. run:
  27. working-directory: dolphinscheduler-python/pydolphinscheduler
  28. jobs:
  29. sanity:
  30. name: Sanity
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@v2
  34. with:
  35. submodules: true
  36. - name: Sanity Check
  37. uses: ./.github/actions/sanity-check
  38. lint:
  39. name: Code Style
  40. runs-on: ubuntu-latest
  41. steps:
  42. - uses: actions/checkout@v2
  43. - name: Set up Python 3.7
  44. uses: actions/setup-python@v2
  45. with:
  46. python-version: 3.7
  47. - name: Install Development Dependences
  48. run: pip install -e .[style]
  49. - name: Run Isort Checking
  50. run: isort --check .
  51. - name: Run Black Checking
  52. run: black --check .
  53. - name: Run Flake8 Checking
  54. run: flake8
  55. pytest:
  56. name: Pytest
  57. needs:
  58. - lint
  59. - sanity
  60. runs-on: ${{ matrix.os }}
  61. strategy:
  62. fail-fast: false
  63. matrix:
  64. python-version: [3.6, 3.7, 3.8, 3.9]
  65. os: [ubuntu-18.04, macOS-latest, windows-latest]
  66. steps:
  67. - uses: actions/checkout@v2
  68. - name: Set up Python ${{ matrix.python-version }}
  69. uses: actions/setup-python@v2
  70. with:
  71. python-version: ${{ matrix.python-version }}
  72. - name: Install dependencies & pydolphinscheduler
  73. run: |
  74. pip install -e .[test]
  75. - name: Run tests
  76. run: |
  77. pytest
  78. coverage:
  79. name: Tests coverage
  80. needs:
  81. - pytest
  82. runs-on: ubuntu-latest
  83. steps:
  84. - uses: actions/checkout@v2
  85. - name: Set up Python 3.7
  86. uses: actions/setup-python@v2
  87. with:
  88. python-version: 3.7
  89. - name: Install Development Dependences
  90. run: |
  91. pip install -e .[test]
  92. - name: Run Tests && Check coverage
  93. run: coverage run && coverage report
  94. doc-build:
  95. name: Document Build Test
  96. needs: pytest
  97. runs-on: ubuntu-latest
  98. steps:
  99. - uses: actions/checkout@v2
  100. - name: Set up Python 3.7
  101. uses: actions/setup-python@v2
  102. with:
  103. python-version: 3.7
  104. - name: Install Development Dependences
  105. run: |
  106. pip install -e .[doc]
  107. - name: Test Build Document
  108. working-directory: dolphinscheduler-python/pydolphinscheduler/docs
  109. run: make clean && make html