name: llt_action
on:
workflow_call:
inputs:
task_name:
required: true
type: string
ut_package:
type: string
default: 'ut_cov_*.tar.gz'
ge_st_rt2:
required: false
type: string
image_version:
required: true
type: string
spec:
description: '机器规格'
required: false
type: string
default: 'xlarge'
jobs:
JOB_ut:
name: UT
steps:
-
name: Checkout
identifier: process_checkout
uses: checkout
with:
ref: ${{ atomgit.event.pull_request.merge_commit_sha }}
-
name: download
uses: obs-download
with:
endpoint: "https://obs.cn-north-4.myhuaweicloud.com"
bucket: "ascend-ci"
key: |
${{ env.obs_path }}/pr_filelist.txt
${{ env.obs_path }}/pr_filelist_mod.txt
${{ env.obs_path }}/ut.sh
path: ${{ steps.process_checkout.outputs.path }}
-
name: redis-cache
uses: cann/.gitcode/actions/redis-cache@master
-
name: ut_acc
identifier: ut
run: |
export WORKSPACE=${{ steps.process_checkout.outputs.path }}
cd ${{ steps.process_checkout.outputs.path }}
export task_name=${{ inputs.task_name }}
export ge_st_rt2=${{ inputs.ge_st_rt2 }}
export ut_type=${{ inputs.ge_st_rt2 }}
export TARGET_BRANCH=${{ env.TARGET_BRANCH }}
bash ut.sh
-
name: ut_cov
identifier: ut_cov
uses: cann/.gitcode/actions/ut-cov-report@master
with:
ut_process: ${{ steps.ut.outputs.ut_process }}
workspace: ${{ steps.process_checkout.outputs.path }}
task_name: ${{ inputs.task_name }}
ut_type: ${{ inputs.ge_st_rt2 }}
target_branch: ${{ env.TARGET_BRANCH }}
-
name: upload
uses: obs-upload
if: ${{ inputs.task_name != 'UT_Test_camodel' && inputs.task_name != 'UT_Test_mmpa' }}
with:
endpoint: "https://obs.cn-north-4.myhuaweicloud.com"
bucket: "ascend-ci"
access-key: ${{secrets.AK}}
secret-key: ${{secrets.SK}}
artifact-path: |
${{ steps.process_checkout.outputs.path }}/${{ inputs.ut_package }}
object-prefix: ${{ env.obs_path }}/
if: "${{ default() }}"
runs-on:
- self-hosted
- arch=x64
- spec=${{ inputs.spec }}
container:
image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }}