From 3493d69fcd8ecd0aff877424035a0c5a4273b578 Mon Sep 17 00:00:00 2001 From: uy/sun Date: Fri, 30 Dec 2022 11:30:47 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20CI:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8F=92=E4=BB=B6=E5=8A=A0=E8=BD=BD=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=20(#1519)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :construction_worker: 添加插件加载测试 * 调整命名格式 * 添加 issue_comment 的触发条件 --- .github/workflows/publish-bot.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-bot.yml b/.github/workflows/publish-bot.yml index 9f8d01ac..dc67dd0c 100644 --- a/.github/workflows/publish-bot.yml +++ b/.github/workflows/publish-bot.yml @@ -5,17 +5,39 @@ on: types: [opened, reopened, edited] pull_request_target: types: [closed] + issue_comment: + types: [created] jobs: + plugin_test: + runs-on: ubuntu-latest + name: nonebot2 plugin test + permissions: + issues: read + outputs: + result: ${{ steps.plugin-test.outputs.RESULT }} + output: ${{ steps.plugin-test.outputs.OUTPUT }} + steps: + - name: Install Poetry + run: pipx install poetry + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Test Plugin + id: plugin-test + run: | + curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2-publish-bot/main/plugin_test.py -o plugin_test.py + python plugin_test.py publish_bot: runs-on: ubuntu-latest name: nonebot2 publish bot + needs: plugin_test steps: - - name: Checkout code + - name: Checkout Code uses: actions/checkout@v3 with: token: ${{ secrets.GH_TOKEN }} - - name: NoneBot2 Publish Bot uses: docker://ghcr.io/nonebot/nonebot2-publish-bot:main with: @@ -27,3 +49,6 @@ jobs: "bot_path": "website/static/bots.json", "adapter_path": "website/static/adapters.json" } + env: + PLUGIN_TEST_RESULT: ${{ needs.plugin_test.outputs.result }} + PLUGIN_TEST_OUTPUT: ${{ needs.plugin_test.outputs.output }}