From 21a71d52bd2074b770807b209939ec11e2c64fa7 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Fri, 28 Jul 2023 17:54:23 +1000 Subject: [PATCH] Enable CodeQL for Android build as per 1CS requirement. (#16875) ### Description Split stages for CPU and CPU+NNAPI builds as CodeQL is enabled at the stage level. We run it for CPU+NNAPI as that covers all the Android code. We don't want to run it for both as duplicate issues would be created for a problem in code included in both builds. ### Motivation and Context --- ...ndroid-x86_64-crosscompile-ci-pipeline.yml | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index e0821d3734..d0efd9debd 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -17,7 +17,11 @@ parameters: default: 0 stages: -- stage: BUILD_STAGE +# Separate stage for building CPU vs NNAPI as we only want CodeQL to run on one of them so we don't get duplicate +# issues for code that is built in both. We pick NNAPI as that includes the NNAPI EP code. +- stage: BUILD_CPU_STAGE + variables: + Codeql.Enabled: false jobs: - job: Build_CPU_EP pool: onnxruntime-Linux-CPU-For-Android-CI @@ -104,9 +108,20 @@ stages: - template: templates/clean-agent-build-directory-step.yml +- stage: BUILD_NNAPI_STAGE + variables: + Codeql.ProjectConfigPath: .github/workflows + Codeql.Enabled: true + Codeql.Language: cpp + ${{ if variables['Codeql.Enabled'] }}: + JobsTimeout: 120 + ${{ else }}: + JobsTimeout: 60 + + jobs: - job: Build_NNAPI_EP pool: onnxruntime-Linux-CPU-For-Android-CI - timeoutInMinutes: 60 + timeoutInMinutes: ${{ variables.JobsTimeout }} workspace: clean: all condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') @@ -188,7 +203,7 @@ stages: - template: templates/clean-agent-build-directory-step.yml - stage: TEST_STAGE - dependsOn: BUILD_STAGE + dependsOn: [BUILD_CPU_STAGE, BUILD_NNAPI_STAGE] jobs: - job: Test_CPU_EP pool: