-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
78 lines (69 loc) · 2.46 KB
/
development-environment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: dev env
on:
pull_request:
paths:
- 'Makefile'
- '.github/actions/*'
- '.github/workflows/development-environment.yml'
- '.envrc'
- 'Brewfile'
- '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: 40
strategy:
matrix:
# 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-11.0, ubuntu-18.04]
fail-fast: false
env:
PIP_DISABLE_PIP_VERSION_CHECK: on
# Make the environment more similar to hat Mac defaults to
SHELL: /bin/zsh
steps:
- name: Checkout sentry
uses: actions/checkout@v2
- name: Set variables for caches
id: info
run: |
echo "::set-output name=brew-cache-dir::$(brew --cache)"
echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
- name: Cache (brew)
uses: actions/cache@v2
with:
path: ${{ steps.info.outputs.brew-cache-dir }}
key: devenv-${{ runner.os }}-brew-${{ hashFiles('Brewfile') }}
restore-keys: devenv-${{ runner.os }}-brew
- name: Install prerequisites
# brew can be finicky but it does not always means that the rest of the job will fail
# Xcode CLI & brew are already installed, thus, no need to call xcode-select install
continue-on-error: true
run: |
make prerequisites
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Cache (pyenv)
uses: actions/cache@v2
with:
path: ~/.pyenv
key: devenv-${{ matrix.os }}-pyenv-${{ hashFiles('.python-version') }}
- name: Cache (yarn)
uses: actions/cache@v1 # We are explicitly using v1 due to perf reasons
with:
path: ${{ steps.info.outputs.yarn-cache-dir }}
key: devenv-${{ matrix.os }}-v2-yarn-${{ hashFiles('yarn.lock') }}
- name: Set up development environment (mostly as per docs)
run: |
curl https://get.volta.sh | bash
export VOLTA_HOME="$HOME/.volta"
export PATH="$HOME/.volta/bin:$PATH"
make setup-pyenv
eval "$(pyenv init --path)"
python -m venv .venv
source .venv/bin/activate
make develop init-config