3
3
pull_request :
4
4
paths :
5
5
- ' Makefile'
6
+ - ' .github/actions/*'
6
7
- ' .github/workflows/development-environment.yml'
7
8
- ' .envrc'
8
9
- ' Brewfile'
17
18
timeout-minutes : 40
18
19
strategy :
19
20
matrix :
20
- # macosx-11.0 is Big Sur, however, it takes long for jobs to get started
21
21
# Using Ubuntu 18 until I figure out this error:
22
22
# -> ImportError: libffi.so.6: cannot open shared object file: No such file or directory
23
23
os : [macos-11.0, ubuntu-18.04]
@@ -31,43 +31,34 @@ jobs:
31
31
- name : Checkout sentry
32
32
uses : actions/checkout@v2
33
33
34
+ - name : Set variables for caches
35
+ id : info
36
+ run : |
37
+ echo "::set-output name=brew-cache-dir::$(brew --cache)"
38
+ echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
39
+
40
+ - name : Cache (brew)
41
+ uses : actions/cache@v2
42
+ with :
43
+ path : ${{ steps.info.outputs.brew-cache-dir }}
44
+ key : devenv-${{ runner.os }}-brew-${{ hashFiles('Brewfile') }}
45
+ restore-keys : devenv-${{ runner.os }}-brew
46
+
34
47
- name : Install prerequisites
35
48
# Xcode CLI & brew are already installed, thus, no need to call xcode-select install
36
49
# Sometimes, brew needs to be updated before brew bundle would work
37
- # After installing Docker (via homebrew) we need to make sure that it is properly initialized on Mac
38
50
run : |
39
- brew update && brew bundle -q
40
- # This code is mentioned in our dev docs. Only remove if you adjust the docs as well
41
- SENTRY_NO_VENV_CHECK=1 ./scripts/do.sh init-docker
51
+ HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade || brew bundle -q
42
52
43
- # The next few steps are to set up the cache quickly
44
- - name : Set environment variables & others
45
- id : info
46
- run : |
47
- echo "::set-output name=python-version::$(SENTRY_NO_VENV_CHECK=1 ./scripts/do.sh get-pyenv-version)"
48
- echo "::set-output name=pip-cache-dir::$(pip3 cache dir)"
49
- echo "::set-output name=pip-version::$(pip -V | awk -F ' ' '{print $2}')"
50
- echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
51
-
52
- # In a sense, we set up Python two times (once here and once via pyenv). Setting
53
- # it up here is instant and it helps us to get the cache primed sooner
54
53
- name : Setup Python
55
- uses : actions/setup-python@v2
56
- with :
57
- python-version : ${{ steps.info.outputs.python-version }}
54
+ uses : ./.github/actions/setup-python
58
55
59
56
- name : Cache (pyenv)
60
57
uses : actions/cache@v2
61
58
with :
62
59
path : ~/.pyenv
63
60
key : devenv-${{ matrix.os }}-pyenv-${{ hashFiles('.python-version') }}
64
61
65
- - name : Cache (pip)
66
- uses : actions/cache@v2
67
- with :
68
- path : ${{ steps.info.outputs.pip-cache-dir }}
69
- key : devenv-${{ matrix.os }}-py${{ steps.info.outputs.python-version }}-pip${{ steps.info.outputs.pip-version }}-${{ hashFiles('**/requirements.txt') }}
70
-
71
62
- name : Cache (yarn)
72
63
uses : actions/cache@v1 # We are explicitly using v1 due to perf reasons
73
64
with :
83
74
eval "$(pyenv init --path)"
84
75
python -m venv .venv
85
76
source .venv/bin/activate
86
- make bootstrap
77
+ if [ docker system info &>/dev/null ]; then
78
+ make bootstrap
79
+ else
80
+ make develop init-config
81
+ fi
87
82
88
83
- name : Test direnv
89
84
run : |
0 commit comments