cli.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. pull_request:
  6. branches:
  7. - "master"
  8. - "dev"
  9. paths-ignore:
  10. - "cmds/**"
  11. - "**.md"
  12. workflow_dispatch:
  13. jobs:
  14. cli-test:
  15. if: github.repository == 'opendatalab/MinerU'
  16. runs-on: pdf
  17. timeout-minutes: 240
  18. strategy:
  19. fail-fast: true
  20. steps:
  21. - name: PDF cli
  22. uses: actions/checkout@v3
  23. with:
  24. fetch-depth: 2
  25. - name: install&test
  26. run: |
  27. source activate mineru
  28. conda env list
  29. pip show coverage
  30. cd $GITHUB_WORKSPACE && sh tests/retry_env.sh
  31. cd $GITHUB_WORKSPACE && python tests/clean_coverage.py
  32. cd $GITHUB_WORKSPACE && coverage run -m pytest tests/unittest/ --cov=magic_pdf/ --cov-report html --cov-report term-missing
  33. cd $GITHUB_WORKSPACE && python tests/get_coverage.py
  34. cd $GITHUB_WORKSPACE && pytest -m P0 -s -v tests/test_cli/test_cli_sdk.py
  35. notify_to_feishu:
  36. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure')}}
  37. needs: cli-test
  38. runs-on: pdf
  39. steps:
  40. - name: notify
  41. run: |
  42. 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":"'$USER_ID'"}]]}}}}' $WEBHOOK_URL