command-line-test.yml 1.9 KB

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