py-ci.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 Black Checking
  50. run: black --check .
  51. - name: Run Flake8 Checking
  52. run: flake8
  53. pytest:
  54. name: Pytest
  55. needs:
  56. - lint
  57. - sanity
  58. runs-on: ${{ matrix.os }}
  59. strategy:
  60. fail-fast: false
  61. matrix:
  62. python-version: [3.6, 3.7, 3.8, 3.9]
  63. os: [ubuntu-18.04, macOS-latest, windows-latest]
  64. steps:
  65. - uses: actions/checkout@v2
  66. - name: Set up Python ${{ matrix.python-version }}
  67. uses: actions/setup-python@v2
  68. with:
  69. python-version: ${{ matrix.python-version }}
  70. - name: Install dependencies & pydolphinscheduler
  71. run: |
  72. pip install -r requirements.txt -r requirements_dev.txt
  73. pip install -e .
  74. - name: Run tests
  75. run: |
  76. pytest