cli.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: PDF
  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: pdf
  21. timeout-minutes: 40
  22. strategy:
  23. fail-fast: true
  24. steps:
  25. - name: config-net
  26. run: |
  27. export http_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  28. export https_proxy=http://bigdata_open_proxy:H89k5qwQRDYfz@10.140.90.20:10811
  29. - name: PDF cli
  30. uses: actions/checkout@v3
  31. with:
  32. fetch-depth: 2
  33. - name: check-requirements
  34. run: |
  35. changed_files=$(git diff --name-only -r HEAD~1 HEAD)
  36. echo $changed_files
  37. if [[ $changed_files =~ "requirements.txt" ]]; then
  38. pip install -r requirements.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 && pytest -s -v tests/test_cli/test_cli.py