forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathazure-pipelines-codeql.yml
More file actions
133 lines (117 loc) · 4.55 KB
/
azure-pipelines-codeql.yml
File metadata and controls
133 lines (117 loc) · 4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
trigger:
none
schedules:
- cron: 0 0 */7 * *
displayName: Periodic CodeQL run
branches:
include:
- dotnet/main-19.x
always: true
variables:
- template: /eng/common-variables.yml
- template: /eng/common/templates/variables/pool-providers.yml
- name: Codeql.Enabled
value: True
- name: Codeql.Language
value: cpp,python
- name: Codeql.Cadence
value: 0
- name: Codeql.TSAEnabled
value: True
- name: Codeql.BuildIdentifier
value: $(System.JobDisplayName)
stages:
- stage: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
jobs:
############ LINUX BUILD ############
- job: Build_Linux
displayName: Linux
timeoutInMinutes: 720
variables:
- _BuildConfig: Release
strategy:
matrix:
x64:
assetManifestOS: linux
assetManifestPlatform: x64
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-amd64
rootfs: /crossrootfs/x64
ExtraArgs: -p:LibsRoot=/crossrootfs/x64/usr/lib/x86_64-linux-gnu
ClangTargetArg: /p:ClangTarget=x86_64-linux-gnu
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch x64
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals build.ubuntu.2204.amd64.open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals build.ubuntu.2204.amd64
container:
image: $(imagename)
steps:
- bash: |
set -ex
git clean -ffdx
git reset --hard HEAD
displayName: 'Clean up working directory'
- bash: |
su -c "tdnf install -y which"
displayName: 'Install CodeQL dependencies'
- bash: |
su -c "tdnf install -y zlib-devel"
displayName: 'Install build dependencies'
- task: CodeQL3000Init@0
displayName: Initialize CodeQL (manually-injected)
- bash: |
echo 'print("Hello world")' > hello.py
python3 hello.py
displayName: 'Run python helloworld'
- bash: |
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) $(ClangBinDirArg) $(ClangTargetArg) $(ExtraArgs)
displayName: 'Build and package'
env:
ROOTFS_DIR: $(rootfs)
- task: CodeQL3000Finalize@0
displayName: Finalize CodeQL (manually-injected)
############ WINDOWS BUILD ############
- job: Build_Windows
condition: false # TODO: this times out, need to investigate why
displayName: Windows
timeoutInMinutes: 720
strategy:
matrix:
# Release
x64_release:
_BuildConfig: Release
assetManifestOS: win
assetManifestPlatform: x64
LLVMTableGenArg: /p:LLVMTableGenPath=$(Build.SourcesDirectory)\artifacts\obj\BuildRoot-x64\bin\llvm-tblgen.exe
ClangTableGenArg: /p:ClangTableGenPath=$(Build.SourcesDirectory)\artifacts\obj\BuildRoot-x64\bin\clang-tblgen.exe
archflag: -arch x64
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64.open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64
steps:
- checkout: self
clean: true
fetchDepth: 2
- script: |
git clean -ffdx
git reset --hard HEAD
displayName: 'Clean up working directory'
- task: CodeQL3000Init@0
displayName: Initialize CodeQL (manually-injected)
- powershell: eng\build.ps1 -ci -restore -build -arch x64 -configuration $(_BuildConfig) $(_InternalBuildArgs) /p:BuildLLVMTableGenOnly=true
displayName: 'Build host llvm-tblgen for cross-compiling'
- powershell: eng\build.ps1 -ci -restore -build -pack $(archflag) -configuration $(_BuildConfig) $(_InternalBuildArgs) $(LLVMTableGenArg) $(ClangTableGenArg)
displayName: 'Build and package'
- task: CodeQL3000Finalize@0
displayName: Finalize CodeQL (manually-injected)