From cb636b96bfb403209d7ba583789d08a1e1dff47a Mon Sep 17 00:00:00 2001 From: Junyan Qin <1010553892@qq.com> Date: Wed, 27 Dec 2023 14:47:02 +0000 Subject: [PATCH 1/2] =?UTF-8?q?test:=20=E9=9B=86=E6=88=90qcg-tester?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-wiki.yml | 5 ---- .github/workflows/test-pr.yml | 43 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test-pr.yml diff --git a/.github/workflows/sync-wiki.yml b/.github/workflows/sync-wiki.yml index 23ca184..0d943c2 100644 --- a/.github/workflows/sync-wiki.yml +++ b/.github/workflows/sync-wiki.yml @@ -1,11 +1,6 @@ name: Update Wiki on: - pull_request: - branches: - - master - paths: - - 'res/wiki/**' push: branches: - master diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml new file mode 100644 index 0000000..f7c026d --- /dev/null +++ b/.github/workflows/test-pr.yml @@ -0,0 +1,43 @@ +name: Test Pull Request + +on: + pull_request: + types: [opened, ready_for_review] + paths: + # 任何py文件改动都会触发 + - '**.py' + +jobs: + perform-test: + runs-on: ubuntu-latest + steps: + # 签出测试工程仓库代码 + - name: Checkout + uses: actions/checkout@v2 + with: + # 仓库地址 + repository: RockChinQ/qcg-tester + # 仓库路径 + path: qcg-tester + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + - name: Install dependencies + run: | + cd qcg-tester + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Set PR Branch as bash env + run: | + echo "BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV + - name: Set OpenAI API Key from Secrets + run: | + echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV + - name: Set OpenAI Reverse Proxy URL from Secrets + run: | + echo "OPENAI_REVERSE_PROXY=${{ secrets.OPENAI_REVERSE_PROXY }}" >> $GITHUB_ENV + - name: Run test + run: | + cd qcg-tester + python main.py From d00c68e3293d8ae9c618c3a7a7f7df44f5e57dd9 Mon Sep 17 00:00:00 2001 From: Junyan Qin <1010553892@qq.com> Date: Wed, 27 Dec 2023 14:49:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=E5=85=81=E8=AE=B8=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index f7c026d..5214153 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -6,6 +6,8 @@ on: paths: # 任何py文件改动都会触发 - '**.py' + # 允许手动触发 + workflow_dispatch: jobs: perform-test: