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] =?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 23ca1848..0d943c21 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 00000000..f7c026d6 --- /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