Skip to content

Commit 73a4140

Browse files
committed
Address pyenv and benchmark_analyzer CI errors
1 parent fb4ac25 commit 73a4140

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.gitlab/benchmarks.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@
6060
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
6161
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
6262
&& rm -rf /var/lib/apt/lists/*
63+
rm -rf "$PYENV_ROOT"
6364
git clone --depth 1 https://github.com/pyenv/pyenv.git --branch "v$PYENV_BRANCH_VERSION" --single-branch "$PYENV_ROOT"
64-
pyenv install "$PYTHON_VERSION"
65+
# Check if Python 3.9.6 is already installed, if not install it
66+
if [ ! -d "$PYENV_ROOT/versions/$PYTHON_VERSION" ]; then
67+
pyenv install "$PYTHON_VERSION"
68+
fi
6569
pyenv global "$PYTHON_VERSION"
6670
- export ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${ARTIFACTS_DIR}"
6771
- export CONVERTED_DIR="${ARTIFACTS_DIR}/converted" && mkdir -p "${CONVERTED_DIR}"
@@ -78,10 +82,12 @@
7882
source /tmp/benchmark-analyzer/.venv/bin/activate
7983
pip install .
8084
sed -i "s#https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog#ssh://[email protected]/DataDog#g" setup.cfg
81-
# Add to PATH so benchmark_analyzer command is available in all script sections
82-
export PATH="/tmp/benchmark-analyzer/.venv/bin:$PATH"
8385
benchmark_analyzer --version || echo "WARNING: benchmark_analyzer --version failed"
8486
fi
87+
- |
88+
if [ -d "/tmp/benchmark-analyzer/.venv/bin" ]; then
89+
export PATH="/tmp/benchmark-analyzer/.venv/bin:$PATH"
90+
fi
8591
# Determine baseline_or_candidate based on branch
8692
- |
8793
if [ "$CI_COMMIT_BRANCH" == "master" ]; then

0 commit comments

Comments
 (0)