benchmark.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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: PDF
  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. pdf-test:
  20. runs-on: pdf
  21. timeout-minutes: 40
  22. strategy:
  23. fail-fast: true
  24. steps:
  25. - name: config-net
  26. run: |
  27. export http_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  28. export https_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  29. - name: PDF benchmark
  30. uses: actions/checkout@v3
  31. with:
  32. fetch-depth: 2
  33. - name: check-requirements
  34. run: |
  35. changed_files=$(git diff --name-only -r HEAD~1 HEAD)
  36. echo $changed_files
  37. if [[ $changed_files =~ "requirements.txt" ]]; then
  38. pip install -r requirements.txt
  39. fi
  40. - name: benchmark
  41. run: |
  42. echo "start test"
  43. cd tools && python text_badcase.py pdf_json_label_0306.json pdf_json_label_0229.json json_files.zip text_badcase text_overall base_data_text.json
  44. cd tools && python ocr_badcase.py pdf_json_label_0306.json ocr_dataset.json json_files.zip ocr_badcase ocr_overall base_data_ocr.json
  45. notify_to_feishu:
  46. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  47. needs: [pdf-test]
  48. runs-on: pdf
  49. steps:
  50. - name: notify
  51. run: |
  52. curl ${{ secrets.WEBHOOK_URL }} -H 'Content-Type: application/json' -d '{
  53. "msgtype": "text",
  54. "text": {
  55. "content": "'${{ github.repository }}' GitHubAction Failed!\n 细节请查看:https://github.com/'${{ github.repository }}'/actions/runs/'${GITHUB_RUN_ID}'"
  56. }
  57. }'