command-line-test.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: command line
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. jobs:
  8. test:
  9. name: cli test
  10. runs-on: ubuntu-20.04
  11. timeout-minutes: 10
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Check for python file changes
  15. uses: getsentry/paths-filter@v2
  16. id: changes
  17. with:
  18. token: ${{ github.token }}
  19. filters: .github/file-filters.yml
  20. - name: Set python version output
  21. id: python-version
  22. run: |
  23. echo "::set-output name=python-version::$(cat .python-version)"
  24. # Until GH composite actions can use `uses`, we need to setup python here
  25. - uses: actions/setup-python@v2
  26. if: steps.changes.outputs.backend == 'true'
  27. with:
  28. python-version: ${{ steps.python-version.outputs.python-version }}
  29. - name: Setup pip
  30. uses: ./.github/actions/setup-pip
  31. id: pip
  32. if: steps.changes.outputs.backend == 'true'
  33. - name: pip cache
  34. uses: actions/cache@v2
  35. if: steps.changes.outputs.backend == 'true'
  36. with:
  37. path: ${{ steps.pip.outputs.pip-cache-dir }}
  38. key: |
  39. ${{ runner.os }}-py${{ steps.python-version.outputs.python-version }}-pip${{ steps.pip.outputs.pip-version }}-${{ secrets.PIP_CACHE_VERSION }}-${{ hashFiles('requirements-*.txt', '!requirements-pre-commit.txt') }}
  40. - name: Setup sentry env
  41. uses: ./.github/actions/setup-sentry
  42. id: setup
  43. if: steps.changes.outputs.backend == 'true'
  44. - name: Run test
  45. if: steps.changes.outputs.backend == 'true'
  46. run: |
  47. make test-cli
  48. - name: Handle artifacts
  49. uses: ./.github/actions/artifacts