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: PDF benchmark
  20. uses: actions/checkout@v3
  21. with:
  22. fetch-depth: 2
  23. - name: check-requirements
  24. run: |
  25. export http_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  26. export https_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  27. changed_files=$(git diff --name-only -r HEAD~1 HEAD)
  28. echo $changed_files
  29. if [[ $changed_files =~ "requirements.txt" ]]; then
  30. pip install -r requirements.txt
  31. fi
  32. - name: benchmark
  33. run: |
  34. echo "start test"
  35. cd tools && python ocr_badcase.py pdf_json_label_0306.json ocr_dataset.json json_files.zip output.json
  36. notify_to_feishu:
  37. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  38. needs: [
  39. pdf-test
  40. ]
  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 }}