Add tests.sh script and use it for CI step to fix sh shell problems
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
735ba92646
commit
a0e7aae504
2 changed files with 29 additions and 4 deletions
|
@ -9,10 +9,7 @@ pipeline:
|
||||||
- unzip -d /opt /opt/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip
|
- unzip -d /opt /opt/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip
|
||||||
- echo /opt/instantclient_* > /etc/ld.so.conf.d/oracle-instantclient.conf
|
- echo /opt/instantclient_* > /etc/ld.so.conf.d/oracle-instantclient.conf
|
||||||
- ldconfig
|
- ldconfig
|
||||||
- python3 -m venv venv
|
- ./tests.sh
|
||||||
- source venv/bin/activate
|
|
||||||
- python3 -m pip install -e ".[dev]"
|
|
||||||
- python3 -m pytest tests
|
|
||||||
build:
|
build:
|
||||||
image: debian
|
image: debian
|
||||||
commands:
|
commands:
|
||||||
|
|
28
tests.sh
Executable file
28
tests.sh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Enter source directory
|
||||||
|
cd $( dirname $0 )
|
||||||
|
|
||||||
|
if [ -d venv ]
|
||||||
|
then
|
||||||
|
VENV=$( realpath venv )
|
||||||
|
TEMP_VENV=0
|
||||||
|
else
|
||||||
|
# Install stdeb in temporary venv
|
||||||
|
VENV=$(mktemp -d)
|
||||||
|
echo "Create a temporary virtualenv in $VENV to install build dependencies..."
|
||||||
|
TEMP_VENV=1
|
||||||
|
python3 -m venv $VENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install package with dev dependencies
|
||||||
|
$VENV/bin/python3 -m pip install -e ".[dev]"
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
$VENV/bin/python3 -m pytest tests
|
||||||
|
RES=$?
|
||||||
|
|
||||||
|
# Clean temporary venv
|
||||||
|
[ $TEMP_VENV -eq 1 ] && rm -fr $VENV
|
||||||
|
|
||||||
|
exit $RES
|
Loading…
Reference in a new issue