gpu-ci.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
  2. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
  3. name: mineru
  4. on:
  5. push:
  6. branches:
  7. - "master"
  8. paths-ignore:
  9. - "cmds/**"
  10. - "**.md"
  11. pull_request:
  12. branches:
  13. - "master"
  14. paths-ignore:
  15. - "cmds/**"
  16. - "**.md"
  17. workflow_dispatch:
  18. jobs:
  19. cli-test:
  20. runs-on: pdf
  21. timeout-minutes: 180
  22. strategy:
  23. fail-fast: true
  24. steps:
  25. - name: PDF cli
  26. uses: actions/checkout@v3
  27. with:
  28. fetch-depth: 2
  29. - name: check-requirements
  30. run: |
  31. source ~/.bashrc
  32. pip install magic-pdf[full-cpu]==0.6.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
  33. pip install https://raw.githubusercontent.com/myhloli/wheels/main/assets/whl/detectron2/detectron2-0.6-cp310-cp310-linux_x86_64.whl
  34. - name: gpu-bench
  35. run: |
  36. echo $GITHUB_WORKSPACE
  37. cd $GITHUB_WORKSPACE && pytest -s -v tests/test_cli/test_bench_gpu.py
  38. notify_to_feishu:
  39. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  40. needs: [cli-test]
  41. runs-on: pdf
  42. steps:
  43. - name: get_actor
  44. run: |
  45. metion_list="dt-yy"
  46. echo $GITHUB_ACTOR
  47. if [[ $GITHUB_ACTOR == "drunkpig" ]]; then
  48. metion_list="xuchao"
  49. elif [[ $GITHUB_ACTOR == "myhloli" ]]; then
  50. metion_list="zhaoxiaomeng"
  51. elif [[ $GITHUB_ACTOR == "icecraft" ]]; then
  52. metion_list="xurui1"
  53. fi
  54. echo $metion_list
  55. echo "METIONS=$metion_list" >> "$GITHUB_ENV"
  56. echo ${{ env.METIONS }}
  57. - name: notify
  58. run: |
  59. curl ${{ secrets.WEBHOOK_URL }} -H 'Content-Type: application/json' -d '{
  60. "msgtype": "text",
  61. "text": {
  62. "mentioned_list": ["${{ env.METIONS }}"] , "content": "'${{ github.repository }}' GitHubAction Failed!\n 细节请查看:https://github.com/'${{ github.repository }}'/actions/runs/'${GITHUB_RUN_ID}'"
  63. }
  64. }'