From 02a35622486edba2bd790530cd19aaafba113951 Mon Sep 17 00:00:00 2001 From: zhangliang2021 Date: Sun, 28 Sep 2025 13:49:42 +0800 Subject: [PATCH 1/4] Update ci.yml --- .gitea/workflows/ci.yml | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 96ccdc8..b02a60e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -12,24 +12,25 @@ jobs: actions: # runs-on: '' steps: - - name: 'pull code' - run: | - git clone https://gitlink.org.cn/zhangliang2021/GPUCodeForces.git . - git log -n 3 - git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/head - git checkout pull/${{ github.event.pull_request.number }}/head - git log -n 3 - git branch -a - - name: 'test' - sh: bash - run: | - script_path=`git diff --name-status origin/main | grep run_code.py | awk '{print $2}'` - if [ -n "${script_path}" ];then - python3 "${script_path}" 2>&1 | tee -a test.log - return_code=${PIPESTATUS[0]} - else - echo "该提交无赛题测试run_code.py测试脚本及其对应测试结果,请判断是否遗漏提交或者非赛题提交,谨慎合并本次提交!" 2>&1 | tee -a test.log - return_code=${PIPESTATUS[0]} - fi - exit $return_code \ No newline at end of file + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: | + rm -rf .//* + git clone https://gitlink.org.cn/zhangliang2021/GPUCodeForces.git . + git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/head + git checkout pull/${{ github.event.pull_request.number }}/head + script_path=`git diff --name-status origin/main | grep run_code.py | awk '{print $2}'` + if [ -n "${script_path}" ];then + python3 "${script_path}" 2>&1 | tee -a test.log + return_code=${PIPESTATUS[0]} + else + echo "该提交无赛题测试run_code.py测试脚本及其对应测试结果,请判断是否遗漏提交或者非赛题提交,谨慎合并本次提交!" 2>&1 | tee -a test.log + return_code=${PIPESTATUS[0]} + fi + exit $return_code + \ No newline at end of file -- 2.34.1 From 9ec2371ad384f2aa68bc586097e5a08481e1764c Mon Sep 17 00:00:00 2001 From: zhangliang2021 Date: Sun, 28 Sep 2025 13:51:28 +0800 Subject: [PATCH 2/4] Update ci.yml --- .gitea/workflows/ci.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b02a60e..88886b3 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,7 +10,6 @@ on: jobs: actions: - # runs-on: '' steps: - name: 'test' uses: appleboy/ssh-action@v1.0.3 @@ -19,15 +18,15 @@ jobs: username: ${{ secrets.USERNAME }} key: ${{ secrets.KEY }} port: ${{ secrets.PORT }} - script: | - rm -rf .//* - git clone https://gitlink.org.cn/zhangliang2021/GPUCodeForces.git . - git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/head - git checkout pull/${{ github.event.pull_request.number }}/head - script_path=`git diff --name-status origin/main | grep run_code.py | awk '{print $2}'` - if [ -n "${script_path}" ];then - python3 "${script_path}" 2>&1 | tee -a test.log - return_code=${PIPESTATUS[0]} + script: | + rm -rf ./* + git clone https://gitlink.org.cn/zhangliang2021/GPUCodeForces.git . + git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/head + git checkout pull/${{ github.event.pull_request.number }}/head + script_path=`git diff --name-status origin/main | grep run_code.py | awk '{print $2}'` + if [ -n "${script_path}" ];then + python3 "${script_path}" 2>&1 | tee -a test.log + return_code=${PIPESTATUS[0]} else echo "该提交无赛题测试run_code.py测试脚本及其对应测试结果,请判断是否遗漏提交或者非赛题提交,谨慎合并本次提交!" 2>&1 | tee -a test.log return_code=${PIPESTATUS[0]} -- 2.34.1 From 6790eccf55859ee374f7f4f08a94563557b2e59f Mon Sep 17 00:00:00 2001 From: zhangliang2021 Date: Tue, 30 Sep 2025 15:51:42 +0800 Subject: [PATCH 3/4] Update ci.yml --- .gitea/workflows/ci.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 88886b3..de691ff 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -12,24 +12,8 @@ jobs: actions: steps: - name: 'test' - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script: | - rm -rf ./* - git clone https://gitlink.org.cn/zhangliang2021/GPUCodeForces.git . - git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/head - git checkout pull/${{ github.event.pull_request.number }}/head - script_path=`git diff --name-status origin/main | grep run_code.py | awk '{print $2}'` - if [ -n "${script_path}" ];then - python3 "${script_path}" 2>&1 | tee -a test.log - return_code=${PIPESTATUS[0]} - else - echo "该提交无赛题测试run_code.py测试脚本及其对应测试结果,请判断是否遗漏提交或者非赛题提交,谨慎合并本次提交!" 2>&1 | tee -a test.log - return_code=${PIPESTATUS[0]} - fi - exit $return_code + run: | + curl -X POST https://cicd.metax-tech.com/job/ccf_GPUCodeForces_gitlink_smoke_test \ + --user ccf_bot:1154beee0ae7063df13f10ca76f4869268 \ + --data-urlencode json='{"parameter": [{"name":"pr_number", "value":"${{ github.event.pull_request.number }}"}]}' \ No newline at end of file -- 2.34.1 From 300b5bc46ed41429e4a24c7f05c0e422be2c3935 Mon Sep 17 00:00:00 2001 From: zhangliang2021 Date: Tue, 30 Sep 2025 15:52:35 +0800 Subject: [PATCH 4/4] Update ci.yml --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index de691ff..92c343c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -14,6 +14,6 @@ jobs: - name: 'test' run: | curl -X POST https://cicd.metax-tech.com/job/ccf_GPUCodeForces_gitlink_smoke_test \ - --user ccf_bot:1154beee0ae7063df13f10ca76f4869268 \ + --user ccf_bot:1154beee0ae7063df13f10ca76f4869268 \ --data-urlencode json='{"parameter": [{"name":"pr_number", "value":"${{ github.event.pull_request.number }}"}]}' \ No newline at end of file -- 2.34.1