update test-load.yml #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Load Nonebot Plugin | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- name: Install UV | |
run: | | |
pip install --upgrade pip | |
pip install uv | |
uv venv .venv | |
echo "uv version:" | |
uv --version | |
- name: Install dependencies and Run Nonebot | |
run: | | |
source .venv/bin/activate | |
export ENVIRONMENT=dev | |
uv pip install pyproject.toml --group test | |
(nb run | tee output.log) & | |
PID=$! | |
trap "kill $PID" EXIT | |
while ! grep -q "Uvicorn running on" output.log; do sleep 1; done | |
kill $PID | |
trap - EXIT | |
- name: Check Load Plugin Failure | |
run: | | |
cat output.log | |
if grep -q 'Failed to import' output.log; then | |
echo "Import failure detected" | |
exit 1 | |
fi |