CI: Be consistent in creating and starting our virtualenv
Before we invoke pip we should always have first created and started our virtualenv. This was done most of the time, but not always. Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -162,6 +162,8 @@ stages:
|
|||||||
- script: |
|
- script: |
|
||||||
git config --global --add safe.directory $(work_dir)
|
git config --global --add safe.directory $(work_dir)
|
||||||
export USER=azure
|
export USER=azure
|
||||||
|
virtualenv -p /usr/bin/python3 /tmp/venv
|
||||||
|
. /tmp/venv/bin/activate
|
||||||
pip install -r test/py/requirements.txt
|
pip install -r test/py/requirements.txt
|
||||||
pip install -r tools/buildman/requirements.txt
|
pip install -r tools/buildman/requirements.txt
|
||||||
pip install asteval pylint==2.12.2 pyopenssl
|
pip install asteval pylint==2.12.2 pyopenssl
|
||||||
@@ -264,6 +266,8 @@ stages:
|
|||||||
if [ -n "\${BUILD_ENV}" ]; then
|
if [ -n "\${BUILD_ENV}" ]; then
|
||||||
export \${BUILD_ENV};
|
export \${BUILD_ENV};
|
||||||
fi
|
fi
|
||||||
|
virtualenv -p /usr/bin/python3 /tmp/venv
|
||||||
|
. /tmp/venv/bin/activate
|
||||||
pip install -r tools/buildman/requirements.txt
|
pip install -r tools/buildman/requirements.txt
|
||||||
tools/buildman/buildman -o \${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board \${TEST_PY_BD} \${OVERRIDE}
|
tools/buildman/buildman -o \${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board \${TEST_PY_BD} \${OVERRIDE}
|
||||||
cp /opt/grub/grub_x86.efi \${UBOOT_TRAVIS_BUILD_DIR}/
|
cp /opt/grub/grub_x86.efi \${UBOOT_TRAVIS_BUILD_DIR}/
|
||||||
@@ -288,8 +292,6 @@ stages:
|
|||||||
/opt/coreboot/cbfstool \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
|
/opt/coreboot/cbfstool \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
|
||||||
/opt/coreboot/cbfstool \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f \${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
|
/opt/coreboot/cbfstool \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f \${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
|
||||||
fi
|
fi
|
||||||
virtualenv -p /usr/bin/python3 /tmp/venv
|
|
||||||
. /tmp/venv/bin/activate
|
|
||||||
pip install -r test/py/requirements.txt
|
pip install -r test/py/requirements.txt
|
||||||
pip install pytest-azurepipelines
|
pip install pytest-azurepipelines
|
||||||
export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:\${PATH}
|
export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:\${PATH}
|
||||||
@@ -581,6 +583,8 @@ stages:
|
|||||||
# make environment variables available as tests are running inside a container
|
# make environment variables available as tests are running inside a container
|
||||||
export BUILDMAN="${BUILDMAN}"
|
export BUILDMAN="${BUILDMAN}"
|
||||||
git config --global --add safe.directory ${WORK_DIR}
|
git config --global --add safe.directory ${WORK_DIR}
|
||||||
|
virtualenv -p /usr/bin/python3 /tmp/venv
|
||||||
|
. /tmp/venv/bin/activate
|
||||||
pip install -r tools/buildman/requirements.txt
|
pip install -r tools/buildman/requirements.txt
|
||||||
EOF
|
EOF
|
||||||
cat << "EOF" >> build.sh
|
cat << "EOF" >> build.sh
|
||||||
|
@@ -55,6 +55,9 @@ stages:
|
|||||||
wget -O /tmp/fip.bin https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/latest/tf-a/fip.bin;
|
wget -O /tmp/fip.bin https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/latest/tf-a/fip.bin;
|
||||||
export BINMAN_INDIRS=/tmp;
|
export BINMAN_INDIRS=/tmp;
|
||||||
fi
|
fi
|
||||||
|
# Prepare python environment
|
||||||
|
- virtualenv -p /usr/bin/python3 /tmp/venv;
|
||||||
|
. /tmp/venv/bin/activate;
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- cp -v /tmp/${TEST_PY_BD}/*.{html,css,xml} .
|
- cp -v /tmp/${TEST_PY_BD}/*.{html,css,xml} .
|
||||||
@@ -90,8 +93,6 @@ stages:
|
|||||||
/opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
|
/opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
|
||||||
/opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
|
/opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
|
||||||
fi
|
fi
|
||||||
- virtualenv -p /usr/bin/python3 /tmp/venv
|
|
||||||
- . /tmp/venv/bin/activate
|
|
||||||
- pip install -r test/py/requirements.txt
|
- pip install -r test/py/requirements.txt
|
||||||
# "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
|
# "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
|
||||||
- export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
|
- export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
|
||||||
@@ -120,6 +121,9 @@ build all platforms in a single job:
|
|||||||
tags:
|
tags:
|
||||||
- ${HOST}
|
- ${HOST}
|
||||||
script:
|
script:
|
||||||
|
# Prepare python environment
|
||||||
|
- virtualenv -p /usr/bin/python3 /tmp/venv;
|
||||||
|
. /tmp/venv/bin/activate;
|
||||||
- ret=0;
|
- ret=0;
|
||||||
git config --global --add safe.directory "${CI_PROJECT_DIR}";
|
git config --global --add safe.directory "${CI_PROJECT_DIR}";
|
||||||
pip install -r tools/buildman/requirements.txt;
|
pip install -r tools/buildman/requirements.txt;
|
||||||
@@ -199,6 +203,8 @@ Run pylint:
|
|||||||
extends: .testsuites
|
extends: .testsuites
|
||||||
script:
|
script:
|
||||||
- git config --global --add safe.directory "${CI_PROJECT_DIR}"
|
- git config --global --add safe.directory "${CI_PROJECT_DIR}"
|
||||||
|
- virtualenv -p /usr/bin/python3 /tmp/venv
|
||||||
|
- . /tmp/venv/bin/activate
|
||||||
- pip install -r test/py/requirements.txt
|
- pip install -r test/py/requirements.txt
|
||||||
- pip install -r tools/buildman/requirements.txt
|
- pip install -r tools/buildman/requirements.txt
|
||||||
- pip install asteval pylint==2.12.2 pyopenssl
|
- pip install asteval pylint==2.12.2 pyopenssl
|
||||||
|
Reference in New Issue
Block a user