|
| 1 | +# |
| 2 | +# See https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/?view=azure-pipelines for details |
| 3 | +# |
| 4 | + |
| 5 | +parameters: |
| 6 | +# Parameter below is ignored in public builds. |
| 7 | +# |
| 8 | +# Choose whether to run the CodeQL3000 tasks. |
| 9 | +# Manual builds align w/ official builds unless this parameter is true. |
| 10 | +- name: runCodeQL3000 |
| 11 | + default: false |
| 12 | + displayName: Run CodeQL3000 tasks |
| 13 | + type: boolean |
| 14 | + |
| 15 | +variables: |
| 16 | +- name: runCodeQL3000 |
| 17 | + value: ${{ and(ne(variables['System.TeamProject'], 'public'), or(eq(variables['Build.Reason'], 'Schedule'), and(eq(variables['Build.Reason'], 'Manual'), eq(parameters.runCodeQL3000, 'true')))) }} |
| 18 | + |
| 19 | +# Only run CI builds for these branches |
| 20 | +trigger: |
| 21 | + branches: |
| 22 | + include: |
| 23 | + - 'main' |
| 24 | + - 'release/*' |
| 25 | +# Run PR validation on all branches |
| 26 | +pr: |
| 27 | + branches: |
| 28 | + include: |
| 29 | + - '*' |
| 30 | + |
| 31 | +name: $(Date:yyyyMMdd)-$(Rev:rr) |
| 32 | + |
| 33 | +jobs: |
| 34 | +- template: build/templates/default-build.yml |
| 35 | + parameters: |
| 36 | + agentOs: Windows |
| 37 | + codeSign: ${{ ne(variables.runCodeQL3000, 'true') }} |
| 38 | + configuration: Release |
| 39 | + ${{ if eq(variables.runCodeQL3000, 'true') }}: |
| 40 | + variables: |
| 41 | + # Security analysis is included in normal runs. Disable its auto-injection. |
| 42 | + skipNugetSecurityAnalysis: true |
| 43 | + # Do not let CodeQL3000 Extension gate scan frequency. |
| 44 | + Codeql.Cadence: 0 |
| 45 | + # Enable CodeQL3000 unconditionally so it may be run on any branch. |
| 46 | + Codeql.Enabled: true |
| 47 | + # Ignore test and infrastructure code. |
| 48 | + Codeql.SourceRoot: src |
| 49 | + # CodeQL3000 needs this plumbed along as a variable to enable TSA. |
| 50 | + Codeql.TSAEnabled: ${{ eq(variables['Build.Reason'], 'Schedule') }} |
| 51 | + # Default expects tsaoptions.json under SourceRoot. |
| 52 | + Codeql.TSAOptionsPath: '$(Build.SourcesDirectory)/.config/tsaoptions.json' |
| 53 | + beforeBuild: |
| 54 | + - task: CodeQL3000Init@0 |
| 55 | + displayName: CodeQL Initialize |
| 56 | + - script: "echo ##vso[build.addbuildtag]CodeQL3000" |
| 57 | + displayName: 'Set CI CodeQL3000 tag' |
| 58 | + condition: ne(variables.CODEQL_DIST,'') |
| 59 | + # Note packages are produced, just not signed, verified, or uploaded. No way to turn off production. |
| 60 | + buildArgs: /p:UseSharedCompilation=false /p:SkipTests=true /p:DisableCodeSigning=true /p:SkipArtifactVerification=true |
| 61 | + afterBuild: |
| 62 | + - task: CodeQL3000Finalize@0 |
| 63 | + displayName: CodeQL Finalize |
| 64 | + ${{ else }}: |
| 65 | + artifacts: |
| 66 | + publish: true |
| 67 | + name: packages |
| 68 | + path: 'artifacts/build/' |
| 69 | + |
| 70 | +- ${{ if ne(variables.runCodeQL3000, 'true') }}: |
| 71 | + - template: build/templates/default-build.yml |
| 72 | + parameters: |
| 73 | + agentOs: macOS |
| 74 | + configuration: Release |
| 75 | + |
| 76 | + - template: build/templates/default-build.yml |
| 77 | + parameters: |
| 78 | + agentOs: Linux |
| 79 | + configuration: Release |
0 commit comments