123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- 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'
- # Cancel in progress workflows on pull_requests.
- # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
- concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
- # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
- env:
- SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
- 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-13
- timeout-minutes: 40
- env:
- # Make the environment more similar to what Mac defaults to
- SHELL: /bin/zsh
- steps:
- - name: Checkout sentry
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- - name: Set up
- id: info
- run: |
- echo "yarn-cache-dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- # 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
- - uses: getsentry/action-setup-volta@c52be2ea13cfdc084edb806e81958c13e445941e # v1.2.0
- # This handles Python's cache
- - uses: getsentry/action-setup-venv@9e3bbae3836b1b6f129955bf55a19e1d99a61c67 # v1.0.5
- with:
- python-version: 3.8.18
- 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
- # GHA pythons are miscompiled and report macos 10.16
- env:
- SYSTEM_VERSION_COMPAT: 0
- run: make bootstrap
- # The pyenv set up takes long, thus, separating it into its own
- pyenv-setup:
- name: pyenv set up
- runs-on: macos-13
- 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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- - 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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- - uses: getsentry/action-setup-venv@9e3bbae3836b1b6f129955bf55a19e1d99a61c67 # v1.0.5
- with:
- python-version: 3.8.18
- cache-dependency-path: |
- requirements-dev.txt
- requirements-dev-frozen.txt
- install-cmd: python3 -m tools.hack_pip && pip install -r requirements-dev.txt -c requirements-dev-frozen.txt
- - name: run tests
- run: make test-tools
- - name: Handle artifacts
- uses: ./.github/actions/artifacts
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
|