build_and_test.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: build and test
  2. on:
  3. pull_request:
  4. branches:
  5. - develop
  6. paths-ignore:
  7. - ".github/**"
  8. - "docs/**"
  9. - "README.md"
  10. concurrency:
  11. group: ${{ github.workflow }}-${{ github.ref }}
  12. cancel-in-progress: true
  13. jobs:
  14. build_and_test_cpu:
  15. runs-on: ${{ matrix.os }}
  16. strategy:
  17. matrix:
  18. os: [ubuntu-latest, windows-latest]
  19. python-version: ["3.7", "3.8"]
  20. steps:
  21. - uses: actions/checkout@v3
  22. - name: Set up Python ${{ matrix.python-version }}
  23. uses: actions/setup-python@v4
  24. with:
  25. python-version: ${{ matrix.python-version }}
  26. - name: Upgrade pip
  27. run: python -m pip install pip --upgrade --user
  28. - name: Install PaddlePaddle
  29. run: python -m pip install paddlepaddle==2.3.1 -i https://mirror.baidu.com/pypi/simple
  30. - name: Install PaddleRS
  31. run: |
  32. pip install -r requirements.txt
  33. pip install -e .
  34. - name: Install pre-commit hooks
  35. run: |
  36. pip install pre-commit
  37. pre-commit install
  38. - name: Lint
  39. run: pre-commit run --all-files
  40. - name: Run unittests
  41. run: |
  42. cd tests
  43. bash check_coverage.sh
  44. shell: bash
  45. build_and_test_cuda102:
  46. runs-on: ubuntu-latest
  47. container:
  48. image: registry.baidubce.com/paddlepaddle/paddle:2.3.1-gpu-cuda10.2-cudnn7
  49. strategy:
  50. matrix:
  51. python-version: ["3.7", "3.8"]
  52. steps:
  53. - uses: actions/checkout@v3
  54. - name: Set up Python ${{ matrix.python-version }}
  55. uses: actions/setup-python@v4
  56. with:
  57. python-version: ${{ matrix.python-version }}
  58. - name: Upgrade pip
  59. run: python -m pip install pip --upgrade --user
  60. - name: Install PaddleRS
  61. run: |
  62. pip install -r requirements.txt
  63. pip install -e .
  64. - name: Install pre-commit hooks
  65. run: |
  66. pip install pre-commit
  67. pre-commit install
  68. - name: Lint
  69. run: pre-commit run --all-files
  70. - name: Run unittests
  71. run: |
  72. cd tests
  73. bash check_coverage.sh
  74. shell: bash