| 1 | #!/bin/sh |
| 2 | # |
| 3 | # SPDX-FileCopyrightText: 2015-2023 Michael Jeanson <mjeanson@efficios.com> |
| 4 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | |
| 6 | set -exu |
| 7 | |
| 8 | SRCDIR="src/barectf" |
| 9 | |
| 10 | PYTHON3="python3" |
| 11 | PYENV_HOME=$WORKSPACE/.pyenv/ |
| 12 | |
| 13 | # Delete previously built virtualenv |
| 14 | if [ -d "$PYENV_HOME" ]; then |
| 15 | rm -rf "$PYENV_HOME" |
| 16 | fi |
| 17 | |
| 18 | # Create virtualenv and install necessary packages |
| 19 | virtualenv -p $PYTHON3 "$PYENV_HOME" |
| 20 | |
| 21 | set +u |
| 22 | # shellcheck disable=SC1090,SC1091 |
| 23 | . "$PYENV_HOME/bin/activate" |
| 24 | set -u |
| 25 | |
| 26 | pip install --quiet poetry tox |
| 27 | |
| 28 | cd "$SRCDIR" |
| 29 | |
| 30 | # test |
| 31 | tox -v |
| 32 | |
| 33 | # EOF |