-
Notifications
You must be signed in to change notification settings - Fork 542
Expand file tree
/
Copy pathcached-testrunner.yml
More file actions
48 lines (47 loc) · 2.08 KB
/
Copy pathcached-testrunner.yml
File metadata and controls
48 lines (47 loc) · 2.08 KB
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
.cached_testrunner:
extends: .testrunner
variables:
PIP_CACHE_DIR: '${{CI_PROJECT_DIR}}/.cache/pip'
EXT_CACHE_VENV: '${{CI_PROJECT_DIR}}/.cache/ext_cache_venv${{PYTHON_VERSION}}'
before_script: |
ulimit -c unlimited
# 3.15 is shipped as the pyenv version "3.15-dev" until
# upstream CPython 3.15 is released. The shim is the usual "python3.15"
# (no -dev suffix on the binary), so build_base_venvs' `python$PYTHON_VERSION`
# works once 3.15-dev is on the `pyenv global` list.
# TODO(vlad): Drop the -dev suffix once the testrunner image installs a GA 3.15.
pyenv global 3.12 3.9 3.10 3.11 3.13 3.14 3.15-dev
export _CI_DD_AGENT_URL=http://${{HOST_IP}}:8126/
set -e -o pipefail
if [ ! -d $EXT_CACHE_VENV ]; then
python$PYTHON_VERSION -m venv $EXT_CACHE_VENV
fi
source $EXT_CACHE_VENV/bin/activate
# Cython 3.3 cp315 wheels SIGSEGV on pre-rc1 3.15; pyproject.toml pin does not apply here.
# TODO(py-315): drop this pin once testrunner 3.15 is 3.15.0rc1+.
if [ "$PYTHON_VERSION" = "3.15" ]; then
python -m pip install cmake setuptools_rust 'Cython<3.3'
else
python -m pip install cmake setuptools_rust Cython
fi
python scripts/ext_cache.py restore
deactivate
after_script: |
set -e -o pipefail
source $EXT_CACHE_VENV/bin/activate
python scripts/ext_cache.py save
deactivate
bash .gitlab/scripts/generate-core-backtraces.sh
cache:
# Share pip between jobs of the same Python version and testrunner image.
# testrunner_image_hash is derived from TESTRUNNER_IMAGE in testrunner.yml at generation time,
# so the cache is automatically invalidated whenever the testrunner image changes.
- key: v7-build_base_venvs-${{PYTHON_VERSION}}-{testrunner_image_hash}-cache-{current_week}
paths:
- .cache
- key: v7-build_base_venvs-${{PYTHON_VERSION}}-{testrunner_image_hash}-ext-{current_week}
paths:
- .ext_cache
- key: v7-build_base_venvs-${{PYTHON_VERSION}}-{testrunner_image_hash}-download-cache-{current_week}
paths:
- .download_cache