benchmark.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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: config-net-reset
  41. run: |
  42. export http_proxy=""
  43. export https_proxy=""
  44. - name: get-benchmark-result
  45. run: |
  46. echo "start test"
  47. 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 --s3_bucket_name llm-process-pperf --s3_file_directory qa-validate/pdf-datasets/badcase --AWS_ACCESS_KEY 7X9CWNHIVOHH3LXRD5WK --AWS_SECRET_KEY IHLyTsv7h4ArzReLWUGZNKvwqB7CMrRi6e7ZyUt0 --END_POINT_URL http://p-ceph-norm-inside.pjlab.org.cn:80
  48. python ocr_badcase.py pdf_json_label_0306.json ocr_dataset.json json_files.zip ocr_badcase ocr_overall base_data_ocr.json --s3_bucket_name llm-process-pperf --s3_file_directory qa-validate/pdf-datasets/badcase --AWS_ACCESS_KEY 7X9CWNHIVOHH3LXRD5WK --AWS_SECRET_KEY IHLyTsv7h4ArzReLWUGZNKvwqB7CMrRi6e7ZyUt0 --END_POINT_URL http://p-ceph-norm-inside.pjlab.org.cn:80
  49. notify_to_feishu:
  50. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  51. needs: [pdf-test]
  52. runs-on: pdf
  53. steps:
  54. - name: notify
  55. run: |
  56. curl ${{ secrets.WEBHOOK_URL }} -H 'Content-Type: application/json' -d '{
  57. "msgtype": "text",
  58. "text": {
  59. "content": "'${{ github.repository }}' GitHubAction Failed!\n 细节请查看:https://github.com/'${{ github.repository }}'/actions/runs/'${GITHUB_RUN_ID}'"
  60. }
  61. }'