cli.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-cli-test
  4. on:
  5. push:
  6. branches:
  7. - "master"
  8. - "dev"
  9. paths-ignore:
  10. - "cmds/**"
  11. - "**.md"
  12. jobs:
  13. cli-test:
  14. if: github.repository == 'opendatalab/MinerU'
  15. runs-on: ubuntu-latest
  16. timeout-minutes: 240
  17. strategy:
  18. fail-fast: true
  19. steps:
  20. - name: PDF cli
  21. uses: actions/checkout@v4
  22. with:
  23. ref: dev
  24. fetch-depth: 2
  25. - name: install uv
  26. uses: astral-sh/setup-uv@v5
  27. - name: install&test
  28. run: |
  29. uv --version
  30. uv venv --python 3.12
  31. source .venv/bin/activate
  32. uv pip install .[test]
  33. cd $GITHUB_WORKSPACE && python tests/clean_coverage.py
  34. cd $GITHUB_WORKSPACE && coverage run
  35. cd $GITHUB_WORKSPACE && python tests/get_coverage.py
  36. notify_to_feishu:
  37. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure')}}
  38. needs: cli-test
  39. runs-on: ubuntu-latest
  40. steps:
  41. - name: notify
  42. run: |
  43. 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}'"}]]}}}}' ${{ secrets.FEISHU_WEBHOOK_URL }}