cli.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. push:
  6. branches:
  7. - "master"
  8. paths-ignore:
  9. - "cmds/**"
  10. - "**.md"
  11. pull_request:
  12. branches:
  13. - "master"
  14. paths-ignore:
  15. - "cmds/**"
  16. - "**.md"
  17. workflow_dispatch:
  18. jobs:
  19. cli-test:
  20. runs-on: mineru
  21. timeout-minutes: 40
  22. strategy:
  23. fail-fast: true
  24. steps:
  25. - name: config-net
  26. run: |
  27. source activate base
  28. - name: PDF cli
  29. uses: actions/checkout@v3
  30. with:
  31. fetch-depth: 2
  32. - name: check-requirements
  33. run: |
  34. changed_files=$(git diff --name-only -r HEAD~1 HEAD)
  35. echo $changed_files
  36. if [[ $changed_files =~ "requirements.txt" ]] || [[ $changed_files =~ "requirements-qa.txt" ]]; then
  37. pip install -r requirements.txt
  38. pip install -r requirements-qa.txt
  39. fi
  40. - name: config-net-reset
  41. run: |
  42. export http_proxy=""
  43. export https_proxy=""
  44. - name: test_cli
  45. run: |
  46. echo $GITHUB_WORKSPACE
  47. cd $GITHUB_WORKSPACE && export PYTHONPATH=. && pytest -s -v tests/test_unit.py
  48. cd $GITHUB_WORKSPACE && pytest -s -v tests/test_cli/test_cli.py