cli.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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: ubuntu-latest
  17. timeout-minutes: 240
  18. strategy:
  19. fail-fast: true
  20. steps:
  21. - name: PDF cli
  22. uses: actions/checkout@v4
  23. with:
  24. ref: dev
  25. fetch-depth: 2
  26. - name: install uv
  27. uses: astral-sh/setup-uv@v5
  28. - name: install&test
  29. run: |
  30. uv --version
  31. uv venv --python 3.12
  32. source .venv/bin/activate
  33. uv pip install .[test]
  34. cd $GITHUB_WORKSPACE && python tests/clean_coverage.py
  35. cd $GITHUB_WORKSPACE && coverage run
  36. cd $GITHUB_WORKSPACE && python tests/get_coverage.py
  37. notify_to_feishu:
  38. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure')}}
  39. needs: cli-test
  40. runs-on: pdf
  41. steps:
  42. - name: notify
  43. run: |
  44. 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