github actions shared lib fix

This commit is contained in:
ThePhaseless
2024-12-11 00:21:07 +00:00
parent 905d802a26
commit b8c8576e5a
4 changed files with 28 additions and 2 deletions
+4 -1
View File
@@ -23,13 +23,16 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
COPY pyproject.toml uv.lock ./
RUN uv sync
COPY github_actions_fix.sh ./
RUN ./github_actions_fix.sh
COPY . .
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver
FROM base AS test
RUN uv sync --group test
RUN . .venv/bin/activate && pytest --retries 2 -n auto --xvfb
RUN ./test.sh
FROM base
+5 -1
View File
@@ -1,3 +1,7 @@
#!/bin/sh
. .venv/bin/activate && python3 main.py
if [ -f ld_fix.sh ]; then
. ./ld_fix.sh
fi
uv run main.py
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# Source .venv
. .venv/bin/activate
# Fix for actions LD_LIBRARY_PATH env
touch ld_fix.sh
PYTHON_PATH=$(which python3)
PYTHON_DIR=$(dirname $PYTHON_PATH)
echo "export LD_LIBRARY_PATH=$PYTHON_DIR/../lib" >> ld_fix.sh
echo "export PATH=$PYTHON_DIR:\$PATH" >> ld_fix.sh
chmod +x ld_fix.sh
Executable
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
if [ -f ./ld_fix.sh ]; then
. ./ld_fix.sh
fi
uv run pytest --retries 2 -n auto --xvfb