py-ci.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 -r requirements_dev.txt
  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 -r requirements.txt -r requirements_dev.txt
  75. pip install -e .
  76. - name: Run tests
  77. run: |
  78. pytest
  79. coverage:
  80. name: Tests coverage
  81. needs:
  82. - pytest
  83. runs-on: ubuntu-latest
  84. steps:
  85. - uses: actions/checkout@v2
  86. - name: Set up Python 3.7
  87. uses: actions/setup-python@v2
  88. with:
  89. python-version: 3.7
  90. - name: Install Development Dependences
  91. run: |
  92. pip install -r requirements_dev.txt
  93. pip install -e .
  94. - name: Run Tests && Check coverage
  95. run: coverage run && coverage report