123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- name: dev env
- on:
- pull_request:
- paths:
- - 'Brewfile'
- - 'Makefile'
- - '.github/workflows/development-environment.yml'
- - 'scripts/*'
- - 'src/sentry/runner/commands/devserver.py'
- - 'src/sentry/runner/commands/devservices.py'
- jobs:
- dev-environment:
- name: set up
- runs-on: ${{ matrix.os }}
- timeout-minutes: 35
- strategy:
- matrix:
- # macosx-10.15 is Catalina
- # macosx-11.0 is Big Sur, however, it takes long for jobs to get started
- # Using Ubuntu 18 until I figure out this error:
- # -> ImportError: libffi.so.6: cannot open shared object file: No such file or directory
- os: [ macos-10.15, macos-11.0, ubuntu-18.04 ]
- fail-fast: false
- env:
- PIP_DISABLE_PIP_VERSION_CHECK: on
- # Make the environment more similar to what Mac defaults to
- SHELL: /bin/zsh
- steps:
- - uses: actions/checkout@v2
- - name: Set environment variables & others
- run: |
- echo "VOLTA_HOME=$HOME/.volta" >> $GITHUB_ENV
- echo "PATH=$HOME/.volta/bin:$PATH" >> $GITHUB_ENV
- touch "$HOME/.zshrc"
- - name: Install prerequisites
- # Xcode CLI & brew are already installed, thus, no need to call xcode-select install
- # XXX: Can the Brew set up be cached?
- # Sometimes, brew needs to be updated before brew bundle would work
- # If you want to speed up the CI for your PR, you can use --no-upgrade and HOMEBREW_NO_AUTO_UPDATE=1
- run: |
- brew bundle || brew update && brew bundle
- - name: Install Python (via Pyenv)
- id: python-version
- # XXX: Can we cache the installed Python environments?
- # We echo to $GITHUB_ENV to make the PATH changes by pyenv init permanent for the rest of the execution
- run: |
- make setup-pyenv
- eval "$(pyenv init -)"
- echo "PATH=$PATH" >> $GITHUB_ENV
- echo "::set-output name=python-version::$(python -V | sed s/Python\ //g)"
- - name: Setup pip
- uses: ./.github/actions/setup-pip
- id: pip
- - name: Cache
- uses: actions/cache@v2
- with:
- path: |
- ${{ steps.pip.outputs.pip-cache-dir }}
- ~/.pyenv
- key: |
- devenv-${{ matrix.os }}-py${{ steps.python-version.outputs.python-version }}-pip${{ steps.pip.outputs.pip-version }}-${{ hashFiles('requirements-*.txt') }}
- restore-keys: |
- devenv-${{ matrix.os }}-py${{ steps.python-version.outputs.python-version }}-pip${{ steps.pip.outputs.pip-version }}
- - name: Get yarn cache directory path
- id: yarn-cache-dir-path
- run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v2
- id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- with:
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
- key: ${{ matrix.os }}-yarn-${{ hashFiles('yarn.lock', 'api-docs/yarn.lock') }}
- restore-keys: |
- ${{ matrix.os }}-yarn-
- - name: Set up development environment (as per docs)
- run: |
- python -m venv .venv
- source .venv/bin/activate
- make install-py-dev
- make setup-git
- curl https://get.volta.sh | bash
- - name: Set up Sentry and others
- # We cannot call make bootstrap directly since run-dependent-services requires some Docker magic.
- # We have the magic in the getsentry/bootstrap-develop. We will handle this situation in the next pass of this.
- # make init-config will *not* prompt about overwriting ~/.sentry/config.yml' since we're on a pristine state
- # We cannot test the git hooks until the `sentry.lint.engine` gets installed
- run: |
- source .venv/bin/activate
- make develop init-config
|