development-environment.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: dev env
  2. on:
  3. pull_request:
  4. paths:
  5. - '.pre-commit-config.yaml'
  6. - 'Makefile'
  7. - '.github/actions/setup-python'
  8. - '.github/workflows/development-environment.yml'
  9. - '.envrc'
  10. - 'Brewfile'
  11. - 'scripts/*'
  12. - 'src/sentry/runner/commands/devserver.py'
  13. - 'src/sentry/runner/commands/devservices.py'
  14. - 'requirements-*.txt'
  15. jobs:
  16. dev-environment:
  17. name: dev docs set up
  18. runs-on: ${{ matrix.os }}
  19. timeout-minutes: 40
  20. strategy:
  21. matrix:
  22. os: [macos-11.0]
  23. fail-fast: false
  24. env:
  25. # Make the environment more similar to what Mac defaults to
  26. SHELL: /bin/zsh
  27. steps:
  28. - name: Checkout sentry
  29. uses: actions/checkout@v2
  30. - name: Set variables for caches
  31. id: info
  32. run: |
  33. echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
  34. - name: Install prerequisites
  35. run: |
  36. make prerequisites
  37. - name: Setup Python
  38. uses: ./.github/actions/setup-python
  39. - name: Cache (pyenv)
  40. uses: actions/cache@v2
  41. with:
  42. path: ~/.pyenv
  43. key: devenv-${{ matrix.os }}-pyenv-${{ hashFiles('.python-version') }}
  44. - name: Cache (yarn)
  45. uses: actions/cache@v1 # We are explicitly using v1 due to perf reasons
  46. with:
  47. path: ${{ steps.info.outputs.yarn-cache-dir }}
  48. key: devenv-${{ matrix.os }}-v1-yarn-${{ hashFiles('yarn.lock') }}
  49. - name: Set up development environment (mostly as per docs)
  50. run: |
  51. curl https://get.volta.sh | bash
  52. export VOLTA_HOME="$HOME/.volta"
  53. export PATH="$HOME/.volta/bin:$PATH"
  54. make setup-pyenv
  55. [[ $(which python) != "${HOME}/.pyenv/shims/python" ]]
  56. source ~/.zprofile
  57. [[ $(which python) == "${HOME}/.pyenv/shims/python" ]]
  58. [[ $(python -V) == "Python $(cat .python-version)" ]]
  59. python -m venv .venv
  60. source .venv/bin/activate
  61. make develop init-config
  62. pre-commit
  63. bootstrap-script:
  64. runs-on: macos-11
  65. timeout-minutes: 40
  66. env:
  67. # Make the environment more similar to what Mac defaults to
  68. SHELL: /bin/zsh
  69. steps:
  70. - name: Run bootstrap code
  71. env:
  72. STRAP_DEBUG: 1
  73. run: |
  74. bash <(curl -s https://raw.githubusercontent.com/getsentry/bootstrap-sentry/main/bootstrap.sh)