daily.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. git checkout "dev"
  24. # cd $GITHUB_WORKSPACE && sh tests/retry_env.sh
  25. cd $GITHUB_WORKSPACE && python tests/clean_coverage.py
  26. cd $GITHUB_WORKSPACE && coverage run -m pytest tests/unittest/ --cov=magic_pdf/ --cov-report html --cov-report term-missing
  27. cd $GITHUB_WORKSPACE && python tests/get_coverage.py
  28. cd $GITHUB_WORKSPACE && pytest -s -v tests/test_cli/test_cli_sdk.py
  29. notify_to_feishu:
  30. if: ${{ always() && !cancelled() && contains(needs.*.result, 'failure') && (github.ref_name == 'master') }}
  31. needs: cli-test
  32. runs-on: pdf
  33. steps:
  34. - name: get_actor
  35. run: |
  36. metion_list="dt-yy"
  37. echo $GITHUB_ACTOR
  38. if [[ $GITHUB_ACTOR == "drunkpig" ]]; then
  39. metion_list="xuchao"
  40. elif [[ $GITHUB_ACTOR == "myhloli" ]]; then
  41. metion_list="zhaoxiaomeng"
  42. elif [[ $GITHUB_ACTOR == "icecraft" ]]; then
  43. metion_list="xurui1"
  44. fi
  45. echo $metion_list
  46. echo "METIONS=$metion_list" >> "$GITHUB_ENV"
  47. echo ${{ env.METIONS }}
  48. - name: notify
  49. run: |
  50. echo ${{ secrets.USER_ID }}
  51. 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 }}