123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- 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
- # After installing Docker (via homebrew) we need to make sure that it is properly initialized on Mac
- run: |
- brew update -q && brew bundle -q
- # This code is mentioned in our dev docs. Only remove if you adjust the docs as well
- SENTRY_NO_VENV_CHECK=1 ./scripts/do.sh init-docker
- - name: Install Python (via Pyenv)
- id: python-version
- # 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-
- # make develop calls "ensure-venv", thus, needing to be within a venv
- # TODO: We need to streamline the installation of the wheel package
- - name: Set up development environment (mostly as per docs)
- run: |
- python -m venv .venv
- source .venv/bin/activate
- pip install wheel
- curl https://get.volta.sh | bash
- make bootstrap
|