diff --git a/.github/workflows/lava-trigger.yml b/.github/workflows/lava-trigger.yml index e593867..5e977c0 100644 --- a/.github/workflows/lava-trigger.yml +++ b/.github/workflows/lava-trigger.yml @@ -87,10 +87,33 @@ jobs: runs-on: 'ubuntu-latest' steps: - - uses: actions/checkout@v6 - with: - repository: ${{ inputs.testcase_repo }} - ref: ${{ inputs.testcase_ref || 'main' }} + - name: checkout scm + shell: bash + run: | + testcase_repo="${{ inputs.testcase_repo }}" + fetch_ref=${{ inputs.testcase_ref || 'main' }} + + if [ "${testcase_repo:0:4}" != 'http' ] or [ "${testcase_repo:0:4}" != 'git@' ]; then + testcase_repo="https://github.com/${testcase_repo}.git" + fi + + git init . + + set -ex + git config user.email rvci@isrc.iscas.ac.cn + git config user.name rvci + git remote add origin "${testcase_repo}" + res=false + for((retry_times=0; retry_times < 10; retry_times++)); do + if git fetch origin "$fetch_ref":"$fetch_ref" --progress; then + res=true + break + fi + sleep 5 + done + [ "$res" = "true" ] && echo "fetch repo success." + + git checkout "$fetch_ref" - name: install depends run: | @@ -224,7 +247,7 @@ jobs: .replace("${job_name}", job_name)\ .replace("${kernel_image_url}", kernel_download_url)\ .replace("${rootfs_image_url}", rootfs_download_url)\ - .replace("${testcase_repo}", f"https://github.com/{testcase_repo}.git")\ + .replace("${testcase_repo}", testcase_repo if testcase_repo.startswith('http', 'git@') else f"https://github.com/{testcase_repo}.git")\ .replace("${testitem_name}", testitem_name)\ .replace("${testcase_path}", testcase_path)\ .replace("${ltp_testsuite}", ltp_testsuite)\ diff --git a/.github/workflows/parse-rvck.yml b/.github/workflows/parse-rvck.yml index 8b59b56..3d602cf 100644 --- a/.github/workflows/parse-rvck.yml +++ b/.github/workflows/parse-rvck.yml @@ -266,7 +266,7 @@ jobs: echo "ISSUE_ID=$(cat ISSUE_ID)" >> $GITHUB_OUTPUT echo "COMMIT_URL=$(cat COMMIT_URL)" >> $GITHUB_OUTPUT echo "NEED_RUN_JOB=$(cat job || echo 'kunit-test,kernel-build,check-patch,lava-trigger')" >> $GITHUB_OUTPUT - echo "testcase_repo=$(cat testcase_repo || echo 'RVCK-Project/lavaci')" >> $GITHUB_OUTPUT + echo "testcase_repo=$(cat testcase_repo || echo 'https://git.openruyi.cn/wangliu-iscas/lavaci-mirror.git')" >> $GITHUB_OUTPUT echo "lava_hardware=$(cat lava_hardware || echo '')" >> $GITHUB_OUTPUT for f in lava_template_*; do [ ! -f "$f" ] && continue