From fd676f8d0809098019c7cfcf23147bb4be7c79d7 Mon Sep 17 00:00:00 2001 From: sanbuphy Date: Fri, 18 Oct 2024 09:18:19 +0800 Subject: [PATCH] fix --- .github/workflows/check.yml | 135 ----------------------------- .github/workflows/check_prompt.yml | 38 ++++++++ 2 files changed, 38 insertions(+), 135 deletions(-) delete mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/check_prompt.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 1157b26..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: Check & Merge Prompt - -permissions: write-all - -on: - pull_request: - types: [ assigned, opened, synchronize, reopened ] - branches: - - main - paths: - - 'test/prompt/**' - - 'tainji/prompt/**' - - '.ci/**' - push: - branches: - - main - paths: - - 'test/prompt/**' - - 'tainji/prompt/**' - - '.ci/**' -jobs: - check : - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 # 检出完整的提交历史 - ref: ${{ github.event.pull_request.head.sha }} - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: check the prompt - run: | - python .ci/check.py - - - name: gpt_prompt to json - env: - folder_path: 'test/prompt/gpt_prompt' - output_path: 'tianji/prompt' - run: python .ci/prompt_to_json_for_CI.py - - - name: yiyan_prompt to json - env: - folder_path: 'test/prompt/yiyan_prompt' - output_path: 'tianji/prompt' - run: python .ci/prompt_to_json_for_CI.py - - - name: aigame_prompt to json - env: - folder_path: 'test/prompt/aigame/zhipu' - output_path: 'tianji/prompt' - run: python .ci/prompt_to_json_for_CI.py - - - name: upload json - uses: actions/upload-artifact@v4.4.3 - with: - name: upload_json - path: tianji/prompt - - - name: Merge the gpt_prompt - env: - gpt_folder_path: 'tianji/prompt/gpt_prompt' - gpt_output_json_path: 'tianji/prompt/gpt_prompt/all_gpt_prompt.json' - run: python .ci/build_all_gpt_prompt.py - - - - name: upload all gpt json - uses: actions/upload-artifact@v4.4.3 - with: - name: upload_all_gpt_json - path: tianji/prompt/gpt_prompt/all_gpt_prompt.json - - - name: Merge the yiyan_prompt - env: - yiyan_folder_path: 'tianji/prompt/yiyan_prompt' - yiyan_output_json_path: 'tianji/prompt/yiyan_prompt/all_yiyan_prompt.json' - run: python .ci/build_all_yiyan_prompt.py - - - name: upload all yiyan json - uses: actions/upload-artifact@v4.4.3 - with: - name: upload_all_yiyan_json - path: tianji/prompt/yiyan_prompt/all_yiyan_prompt.json - - - name: Merge the aigame_prompt - env: - aigame_folder_path: 'tianji/prompt/aigame' - aigame_output_json_path: 'tianji/prompt/aigame/all_aigame_prompt.json' - run: python .ci/build_all_aigame_prompt.py - - - name: Install matplotlib - run: | - python -m pip install --upgrade pip - pip install matplotlib - - - name: Count the number of gpt prompts - env: - all_gpt_json: 'tianji/prompt/gpt_prompt/all_gpt_prompt.json' - run : python .ci/gpt_prompt_stat.py - mv gpt_prompt_statistics.png .ci/gpt_prompt_statistics.png - - - name: upload gpt png - uses: actions/upload-artifact@v4.4.3 - with: - name: gpt_prompt_statistics # 工件的名称,您可以根据需要命名 - path: .ci/gpt_prompt_statistics.png # 指定生成的 PNG 文件的路径 - - - name: Count the number of yiyan prompts - env: - all_yiyan_json: 'tianji/prompt/yiyan_prompt/all_yiyan_prompt.json' - run : python .ci/yiyan_prompt_stat.py - mv yiyan_prompt_statistics.png .ci/yiyan_prompt_statistics.png - - - - name: upload yiyan png - uses: actions/upload-artifact@v4.4.3 - with: - name: yiyan_prompt_statistics # 工件的名称,您可以根据需要命名 - path: .ci/yiyan_prompt_statistics.png # 指定生成的 PNG 文件的路径 - - - name: Configure Git credentials - run: | - git config user.name ${{ secrets.GIT_USER }} - git config user.email ${{ secrets.GIT_EMAIL }} - - - name: Commit and push changes - run: | - git add . - git commit -m "Auto commit after PR merge" - git push diff --git a/.github/workflows/check_prompt.yml b/.github/workflows/check_prompt.yml new file mode 100644 index 0000000..506f4cb --- /dev/null +++ b/.github/workflows/check_prompt.yml @@ -0,0 +1,38 @@ +name: Check Prompt + +permissions: read-all + +on: + pull_request: + types: [ assigned, opened, synchronize, reopened ] + branches: + - main + paths: + - 'test/prompt/**' + - 'tainji/prompt/**' + - '.ci/**' + push: + branches: + - main + paths: + - 'test/prompt/**' + - 'tainji/prompt/**' + - '.ci/**' +jobs: + check : + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # 检出完整的提交历史 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: check the prompt + run: | + python .ci/check.py