daily.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. schedule:
  6. - cron: '0 22 * * *' # 每天晚上 10 点执行
  7. jobs:
  8. cli-test:
  9. runs-on: pdf
  10. timeout-minutes: 240
  11. strategy:
  12. fail-fast: true
  13. steps:
  14. - name: PDF cli
  15. uses: actions/checkout@v3
  16. with:
  17. fetch-depth: 2
  18. - name: install&test
  19. run: |
  20. source activate mineru
  21. conda env list
  22. pip show coverage
  23. # cd $GITHUB_WORKSPACE && sh tests/retry_env.sh
  24. cd $GITHUB_WORKSPACE && python tests/clean_coverage.py
  25. cd $GITHUB_WORKSPACE && coverage run -m pytest tests/unittest/ --cov=magic_pdf/ --cov-report html --cov-report term-missing
  26. cd $GITHUB_WORKSPACE && python tests/get_coverage.py
  27. cd $GITHUB_WORKSPACE && pytest -s -v tests/test_cli/test_cli_sdk.py
  28. notify_to_feishu:
  29. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  30. needs: cli-test
  31. runs-on: pdf
  32. steps:
  33. - name: get_actor
  34. run: |
  35. metion_list="dt-yy"
  36. echo $GITHUB_ACTOR
  37. if [[ $GITHUB_ACTOR == "drunkpig" ]]; then
  38. metion_list="xuchao"
  39. elif [[ $GITHUB_ACTOR == "myhloli" ]]; then
  40. metion_list="zhaoxiaomeng"
  41. elif [[ $GITHUB_ACTOR == "icecraft" ]]; then
  42. metion_list="xurui1"
  43. fi
  44. echo $metion_list
  45. echo "METIONS=$metion_list" >> "$GITHUB_ENV"
  46. echo ${{ env.METIONS }}
  47. - name: notify
  48. run: |
  49. echo ${{ secrets.USER_ID }}
  50. 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 }}