development-environment.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: dev env
  2. on:
  3. pull_request:
  4. paths:
  5. - '.pre-commit-config.yaml'
  6. - 'Makefile'
  7. - '.github/actions/*'
  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. jobs:
  15. dev-environment:
  16. name: dev docs set up
  17. runs-on: ${{ matrix.os }}
  18. timeout-minutes: 40
  19. strategy:
  20. matrix:
  21. # Using Ubuntu 18 until I figure out this error:
  22. # -> ImportError: libffi.so.6: cannot open shared object file: No such file or directory
  23. os: [macos-11.0, ubuntu-18.04]
  24. python-version: [3.8.12]
  25. fail-fast: false
  26. env:
  27. PIP_DISABLE_PIP_VERSION_CHECK: on
  28. # Make the environment more similar to what Mac defaults to
  29. SHELL: /bin/zsh
  30. steps:
  31. - name: Checkout sentry
  32. uses: actions/checkout@v2
  33. - name: Set variables for caches
  34. id: info
  35. run: |
  36. echo "::set-output name=brew-cache-dir::$(brew --cache)"
  37. echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
  38. - name: Cache (brew)
  39. uses: actions/cache@v2
  40. with:
  41. path: ${{ steps.info.outputs.brew-cache-dir }}
  42. key: devenv-${{ runner.os }}-brew-${{ hashFiles('Brewfile') }}
  43. restore-keys: devenv-${{ runner.os }}-brew
  44. - name: Install prerequisites
  45. # brew can be finicky but it does not always means that the rest of the job will fail
  46. # Xcode CLI & brew are already installed, thus, no need to call xcode-select install
  47. continue-on-error: true
  48. run: |
  49. make prerequisites
  50. - name: Setup Python ${{ matrix.python-version }}
  51. uses: ./.github/actions/setup-python
  52. with:
  53. python-version: ${{ matrix.python-version }}
  54. - name: Cache (pyenv)
  55. uses: actions/cache@v2
  56. with:
  57. path: ~/.pyenv
  58. key: devenv-${{ matrix.os }}-pyenv-${{ hashFiles('.python-version') }}
  59. - name: Cache (yarn)
  60. uses: actions/cache@v1 # We are explicitly using v1 due to perf reasons
  61. with:
  62. path: ${{ steps.info.outputs.yarn-cache-dir }}
  63. key: devenv-${{ matrix.os }}-v2-yarn-${{ hashFiles('yarn.lock') }}
  64. - name: Set up development environment (mostly as per docs)
  65. run: |
  66. curl https://get.volta.sh | bash
  67. export VOLTA_HOME="$HOME/.volta"
  68. export PATH="$HOME/.volta/bin:$PATH"
  69. make setup-pyenv
  70. eval "$(pyenv init --path)"
  71. python -m venv .venv
  72. source .venv/bin/activate
  73. make develop init-config
  74. bootstrap-script:
  75. runs-on: macos-11
  76. timeout-minutes: 45
  77. env:
  78. PIP_DISABLE_PIP_VERSION_CHECK: on
  79. # Make the environment more similar to what Mac defaults to
  80. SHELL: /bin/zsh
  81. steps:
  82. - name: Run bootstrap code
  83. env:
  84. STRAP_DEBUG: 1
  85. run: |
  86. bash <(curl -s https://raw.githubusercontent.com/getsentry/bootstrap-sentry/main/bootstrap.sh)