已合并
下线codecheck #1099
cui_jiahao创建于 26 天前
下线codecheck #1099
已合并
共 2 个文件变更+88-2
| @@ -24,7 +24,7 @@ env: | |||
| 24 | MERGE_ID: ${{ atomgit.event.pull_request.number }} | 24 | MERGE_ID: ${{ atomgit.event.pull_request.number }} |
| 25 | TARGET_BRANCH: ${{ atomgit.base_ref }} | 25 | TARGET_BRANCH: ${{ atomgit.base_ref }} |
| 26 | SOURCE_BRANCH: ${{ atomgit.head_ref }} | 26 | SOURCE_BRANCH: ${{ atomgit.head_ref }} |
| 27 | - obs_path: "${{ vars.OBS_PATH }}/${{ env.MERGE_ID }}" | 27 | + obs_path: "${{ env.org_name }}/${{ env.repo_name }}/ci/package/${{ env.MERGE_ID }}" |
| 28 | online: ${{ vars.APPLY_LABEL }} | 28 | online: ${{ vars.APPLY_LABEL }} |
| 29 | 29 | ||
| 30 | stages: | 30 | stages: |
| @@ -55,7 +55,7 @@ stages: | |||
| 55 | jobs: | 55 | jobs: |
| 56 | JOB_codecheck: | 56 | JOB_codecheck: |
| 57 | name: CodeCheck | 57 | name: CodeCheck |
| 58 | - uses: cann/.gitcode/.gitcode/workflows/codecheck_action.yml@master | 58 | + uses: .gitcode/workflows/codecheck_action.yml |
| 59 | with: | 59 | with: |
| 60 | precommit_image_version: ${{ jobs.JOB_image.outputs.precommit }} | 60 | precommit_image_version: ${{ jobs.JOB_image.outputs.precommit }} |
| 61 | codecheck_image_version: ${{ jobs.JOB_image.outputs.codecheck }} | 61 | codecheck_image_version: ${{ jobs.JOB_image.outputs.codecheck }} |
| @@ -0,0 +1,86 @@ | |||
| 1 | +name: codecheck_action | ||
L | |||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + workflow_call: | ||
| 5 | + inputs: | ||
| 6 | + precommit_image_version: | ||
| 7 | + required: true | ||
| 8 | + type: string | ||
| 9 | + codecheck_image_version: | ||
| 10 | + required: true | ||
| 11 | + type: string | ||
| 12 | + | ||
| 13 | + | ||
| 14 | +jobs: | ||
| 15 | + JOB_precommit: | ||
| 16 | + name: CodeCheck_precommit | ||
| 17 | + steps: | ||
| 18 | + - | ||
| 19 | + name: Checkout | ||
| 20 | + identifier: process_checkout | ||
| 21 | + uses: checkout | ||
| 22 | + with: | ||
| 23 | + ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 24 | + token: ${{secrets.GIT_TOKEN}} | ||
| 25 | + - | ||
| 26 | + name: download | ||
| 27 | + uses: obs-download | ||
| 28 | + with: | ||
| 29 | + endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | ||
| 30 | + bucket: "ascend-ci" | ||
| 31 | + key: "${{ env.obs_path }}/pr_filelist_precommit.txt" | ||
| 32 | + path: ${{ steps.process_checkout.outputs.path }} | ||
| 33 | + - | ||
| 34 | + name: precommit | ||
| 35 | + identifier: precommit | ||
| 36 | + uses: cann/.gitcode/actions/precommit@master | ||
| 37 | + with: | ||
| 38 | + merge_id: ${{ env.MERGE_ID }} | ||
| 39 | + repo_name: ${{ env.repo_name }} | ||
| 40 | + workspace: ${{ steps.process_checkout.outputs.path }} | ||
| 41 | + block: ${{ vars.PRECOMMIT_BLOCK }} | ||
| 42 | + - | ||
| 43 | + name: upload | ||
| 44 | + if: ${{ always() }} | ||
| 45 | + uses: obs-upload | ||
| 46 | + with: | ||
| 47 | + endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | ||
| 48 | + bucket: "ascend-ci" | ||
| 49 | + access-key: ${{secrets.AK}} | ||
| 50 | + secret-key: ${{secrets.SK}} | ||
| 51 | + artifact-path: "${{ steps.process_checkout.outputs.path }}/pre-commit*.txt" | ||
| 52 | + object-prefix: ${{ env.obs_path }}/ | ||
| 53 | + if: "${{ default() }}" | ||
| 54 | + runs-on: ['self-hosted', 'arch=x64', 'spec=small'] | ||
| 55 | + container: | ||
| 56 | + image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.precommit_image_version }} | ||
| 57 | + JOB_check_pr: | ||
| 58 | + name: CodeCheck_check-pr | ||
| 59 | + steps: | ||
| 60 | + - | ||
| 61 | + name: Checkout | ||
| 62 | + identifier: process_checkout | ||
| 63 | + uses: checkout | ||
| 64 | + with: | ||
| 65 | + ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 66 | + token: ${{secrets.GIT_TOKEN}} | ||
| 67 | + - | ||
| 68 | + name: download | ||
| 69 | + uses: obs-download | ||
| 70 | + with: | ||
| 71 | + endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | ||
| 72 | + bucket: "ascend-ci" | ||
| 73 | + key: | | ||
| 74 | + ${{ env.obs_path }}/pr_filelist.txt | ||
| 75 | + ${{ env.obs_path }}/pr_filelist_mod.txt | ||
| 76 | + path: ${{ steps.process_checkout.outputs.path }} | ||
| 77 | + - | ||
| 78 | + name: check-pr | ||
| 79 | + identifier: check-pr | ||
| 80 | + uses: cann/.gitcode/actions/check-pr@master | ||
| 81 | + with: | ||
| 82 | + repo_name: ${{ env.repo_name }} | ||
| 83 | + workspace: ${{ steps.process_checkout.outputs.path }} | ||
| 84 | + runs-on: ['self-hosted', 'arch=x64', 'spec=small'] | ||
| 85 | + container: | ||
| 86 | + image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.codecheck_image_version }} | ||
可以引用.gitcode仓统一的codecheck_action