name: dev env on: pull_request: paths: - '.pre-commit-config.yaml' - 'Makefile' - '.github/workflows/development-environment.yml' - 'requirements-*.txt' - '.python-version' - '.envrc' - 'Brewfile' - 'scripts/*' - 'tools/*' - 'src/sentry/runner/commands/devserver.py' - 'src/sentry/runner/commands/devservices.py' - 'bin/load-mocks' jobs: # This workflow is optimized to test the dev env with dev services as fast as possible # The bootstrap workflow (see last workflow) tests the experience of first time engineers docker-setup: name: Docker set up runs-on: macos-11 timeout-minutes: 30 env: # Make the environment more similar to what Mac defaults to SHELL: /bin/zsh steps: - name: Checkout sentry uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2 - name: Set up id: info run: | echo "::set-output name=yarn-cache-dir::$(yarn cache dir)" # Trick for unattended Docker installations # https://github.com/docker/for-mac/issues/2359#issuecomment-943131345 # NOTE: This can sometimes take up to 10 minutes - name: Install Docker run: | # d4m 4.11+ never starts: https://github.com/docker/for-mac/issues/6450 curl -o /tmp/docker.rb https://raw.githubusercontent.com/Homebrew/homebrew-cask/fe866ec0765de141599745f03e215452db7f511b/Casks/docker.rb HOMEBREW_NO_AUTO_UPDATE=1 brew install -v --HEAD -s /tmp/docker.rb sudo /Applications/Docker.app/Contents/MacOS/Docker --unattended --install-privileged-components open -a /Applications/Docker.app --args --unattended --accept-license - name: Install missing brew packages run: | HOMEBREW_NO_AUTO_UPDATE=1 brew install -v libxmlsec1 - uses: ./.github/actions/setup-volta # This handles Python's cache - name: Setup Python & cache uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # v4 with: python-version: 3.8.13 cache: 'pip' cache-dependency-path: requirements-dev-frozen.txt # This tests starting up the dev services, loading mocks and pre-commit installation # This can take over 15 minutes - name: make bootstrap run: | python -m venv .venv source .venv/bin/activate make bootstrap # The pyenv set up takes long, thus, separating it into its own pyenv-setup: name: pyenv set up runs-on: macos-11 timeout-minutes: 25 env: # This is to support this code https://github.com/getsentry/sentry/blob/47b837a69c38e190a7555de81e6d7d216498b854/scripts/pyenv_setup.sh#L17-L40 SHELL: /bin/zsh steps: - name: Checkout sentry uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2 - name: Install pyenv run: | HOMEBREW_NO_AUTO_UPDATE=1 brew install pyenv # Only after we source ~/.zprofile that the right Python will be selected - name: Set up pyenv run: | make setup-pyenv [[ $(which python) != "${HOME}/.pyenv/shims/python" ]] source ~/.zprofile [[ $(which python) == "${HOME}/.pyenv/shims/python" ]] [[ $(python -V) == "Python $(cat .python-version)" ]] python -m venv .venv source .venv/bin/activate [[ $(python -V) == "Python $(cat .python-version)" ]] tools-tests: runs-on: ubuntu-20.04 timeout-minutes: 5 steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3 - uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # v4 with: python-version: 3.8.13 cache: pip cache-dependency-path: requirements-dev-only-frozen.txt - name: install dependencies run: pip install -r requirements-dev-only-frozen.txt - name: run tests run: make test-tools - name: Handle artifacts uses: ./.github/actions/artifacts # We don't yet test the bootstrap step # https://github.com/getsentry/bootstrap-sentry/blob/7af557be84920dd587e48613dbc308c937bc0e08/bootstrap.sh#L618-L619 bootstrap-script: runs-on: macos-11 timeout-minutes: 40 env: # Make the environment more similar to what Mac defaults to SHELL: /bin/zsh steps: - name: Run bootstrap code env: STRAP_DEBUG: 1 # This ensures that the bootstrap code will test against this branch CI_CHECKOUT_BRANCH: ${{ github.head_ref || github.sha }} run: | bash <(curl -s https://raw.githubusercontent.com/getsentry/bootstrap-sentry/main/bootstrap.sh)