From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.2365.1672965870989415565 for ; Thu, 05 Jan 2023 16:44:31 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FFgf7wbf; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: gua.guo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672965870; x=1704501870; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XoYunQlTJ0cJ+zb0MIZEYF20dLWt31iCp7SjW/caU8Y=; b=FFgf7wbfoaAgtWqh1+IIPP+7xJgQcWeMYd/4bHooLB33958sGdtYlkW1 wLfR63BwafRjg4Ct7YrlUsqLboAwGGW2ODX++X8j5zm8LSw2D+dOFJFb1 J/QDOss/cTpJEPdRAGLsLLxrDOQO+tXFHAbWlUZGPj3BHQ0oBsKhg+fgt xvLpJDD7Aqbz3bdzIrgVn/GHSC5MF3EslqsbG7itsLCM/v/w22fLIosyG PHi2gsDAKHZOlgWn1PJjo4GjxhMMdtCYC6WeHcBMaukYyxuOyxzFRBQZ2 /O2WRoxQ/JFIbN0kUmzWpqUoV1oAp1Xbmty7nokRP/bhV9RzNX0G8zx7X g==; X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="305883516" X-IronPort-AV: E=Sophos;i="5.96,303,1665471600"; d="scan'208";a="305883516" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2023 16:44:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="649148729" X-IronPort-AV: E=Sophos;i="5.96,303,1665471600"; d="scan'208";a="649148729" Received: from gguo-desk.gar.corp.intel.com ([10.5.215.23]) by orsmga007.jf.intel.com with ESMTP; 05 Jan 2023 16:44:28 -0800 From: "Guo, Gua" To: devel@edk2.groups.io Cc: Gua Guo , Sean Brogan , Michael Kubacki , Michael D Kinney , Liming Gao Subject: [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found Date: Fri, 6 Jan 2023 08:44:24 +0800 Message-Id: <4f8e95f65b608131ac7645cc3824624e913954fd.1672965793.git.gua.guo@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Gua Guo Skip CodeCoverage if coverage.xml not found Cc: Sean Brogan Cc: Michael Kubacki Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Gua Guo --- .azurepipelines/templates/pr-gate-build-job.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipeli= nes/templates/pr-gate-build-job.yml index 840852b606..fff61a3193 100644 --- a/.azurepipelines/templates/pr-gate-build-job.yml +++ b/.azurepipelines/templates/pr-gate-build-job.yml @@ -100,16 +100,24 @@ jobs: buildType: 'current'=0D targetPath: '$(Build.ArtifactStagingDirectory)'=0D =0D + - powershell: Write-Host "##vso[task.setvariable variable=3Dis_code_co= verage]0"=0D + displayName: Give default value for whether CodeCoverage or not=0D +=0D + - powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**= /coverage.xml) {Write-Host "##vso[task.setvariable variable=3Dis_code_cover= age]1"}=0D + displayName: Check coverage.xml exist or not=0D +=0D - task: CmdLine@2=0D displayName: Create code coverage report=0D inputs:=0D script: |=0D dotnet tool install -g dotnet-reportgenerator-globaltool=0D reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/co= verage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttyp= es:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*=0D + condition: eq(variables.is_code_coverage, 1)=0D =0D - task: PublishCodeCoverageResults@1=0D displayName: 'Publish code coverage'=0D inputs:=0D codeCoverageTool: Cobertura=0D summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/C= obertura.xml'=0D + condition: eq(variables.is_code_coverage, 1)=0D =0D --=20 2.31.1.windows.1