build_and_test.yaml 1.9 KB

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