mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 01:40:21 +08:00
github actions shared lib fix
This commit is contained in:
parent
b0fb72dff2
commit
986f7446bf
@ -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
|
||||
|
||||
|
6
cmd.sh
6
cmd.sh
@ -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
github_actions_fix.sh
Executable file
12
github_actions_fix.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user