generated from fllesser/nonebot-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.16 KB
/
test-load.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Test Load Nonebot Plugin
on:
push:
branches:
- '*'
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 Poetry
run: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install poetry==2.0.0
echo "Poetry version:"
poetry --version
- name: Install dependencies
run: |
source .venv/bin/activate
export POETRY_ENV=test
poetry install
- name: Run Nonebot
run: |
source .venv/bin/activate
export ENVIRONMENT=dev
(poetry run nb run | tee output.log) &
PID=$!
trap "kill $PID" EXIT
while ! grep -q "Uvicorn running" 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