benchmark.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. workflow_dispatch:
  12. jobs:
  13. pdf-test:
  14. runs-on: pdf
  15. timeout-minutes: 40
  16. strategy:
  17. fail-fast: true
  18. steps:
  19. - name: config-net
  20. run: |
  21. export http_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  22. export https_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  23. - name: PDF benchmark
  24. uses: actions/checkout@v3
  25. with:
  26. fetch-depth: 2
  27. - name: check-requirements
  28. run: |
  29. changed_files=$(git diff --name-only -r HEAD~1 HEAD)
  30. echo $changed_files
  31. if [[ $changed_files =~ "requirements.txt" ]]; then
  32. pip install -r requirements.txt
  33. fi
  34. - name: benchmark
  35. run: |
  36. echo "start test"
  37. cd tools && python ocr_badcase.py pdf_json_label_0306.json ocr_dataset.json json_files.zip badcase.json overall.json base_data.json
  38. notify_to_feishu:
  39. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  40. needs: [pdf-test]
  41. runs-on: [pdf]
  42. steps:
  43. - name: notify
  44. run: |
  45. curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"post","content":{"post":{"zh_cn":{"title":"'${{ github.repository }}' GitHubAction Failed","content":[[{"tag":"text","text":""},{"tag":"a","text":"Please click here for details ","href":"https://github.com/'${{ github.repository }}'/actions/runs/'${GITHUB_RUN_ID}'"},{"tag":"at","user_id":"'${{ secrets.USER_ID }}'"}]]}}}}' ${{ secrets.WEBHOOK_URL }}