This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
forked from getsentry/sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (118 loc) · 4.35 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: dev env
on:
pull_request:
paths:
- '.pre-commit-config.yaml'
- 'Makefile'
- '.github/workflows/development-environment.yml'
- 'requirements-*.txt'
- '.python-version'
- '.github/actions/setup-python'
- '.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@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: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install -v --cask docker
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: ./.github/actions/setup-python
# Remove this block when 3.8.13 becomes available in:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
with:
python-version: 3.8.12
# 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@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@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8.12
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)