-
Notifications
You must be signed in to change notification settings - Fork 45
759 lines (641 loc) · 27.7 KB
/
buildPipeline.yml
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
# This is a basic workflow to help you get started with Actions
name: Build and test
# Controls when the workflow will run
on:
# Triggers the workflow on pull request events but only for the "master" branch
pull_request:
branches: [ "master" ]
permissions:
id-token: write
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This job tests running on hardware with a custom path to libdcap_quoteprov.so
ACCTest:
strategy:
# Launch a VM and build once per each combination of linux image, VM size and buildType
max-parallel: 1
matrix:
sizeName: [IceLake, CoffeeLake]
imageName: ["Ubuntu20_04"]
buildType: [RelWithDebInfo, Debug]
include:
- imageUrn: "Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest"
imageName: Ubuntu20_04
- sizeName: CoffeeLake
size: Standard_DC4s_v2
location: uksouth
- sizeName: IceLake
size: Standard_DC4s_v3
location: westus
# OS of the Github VM calling Azure CLI
runs-on: ubuntu-latest
# Job environment variables
env:
os: linux
vmName: dcapACCTestBuildVM${{ github.run_number }}${{ matrix.sizeName }}${{ matrix.imageName }}${{ matrix.buildType }}
rgName: dcap-github-actions-agents-rg
location: ${{ matrix.location }}
branchName: ${{ github.head_ref }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Create VM
uses: azure/CLI@v1
with:
inlineScript: |
az vm create \
--resource-group $rgName \
--name $vmName \
--image ${{ matrix.imageUrn }} \
--size ${{ matrix.size }} \
--location ${{ matrix.location }} \
--admin-username ${{ secrets.BUILD_VM_USERNAME }} \
--admin-password ${{ secrets.BUILD_VM_PASSWORD }} \
--nic-delete-option delete \
--os-disk-delete-option delete \
--public-ip-sku Standard
- name: Sleep to let the VM start
run: sleep 60
- name: Install software properties common
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSoftwarePropertiesCommon"
script: "sudo apt-get install software-properties-common -y"
- name: Add ppa repository
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "addPpaRepository"
script: "sudo add-apt-repository ppa:team-xbmc/ppa -y"
- name: Update apt-get
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "updateAptGet"
script: "sudo apt-get update -y"
- name: Install libSSL
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installLibSSL"
script: "sudo apt-get install libssl-dev -y"
- name: Install openSSL
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installOpenSSL"
script: "sudo apt-get install libcurl4-openssl-dev -y"
- name: Install PkgConfig
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installPkgConfig"
script: "sudo apt-get install pkg-config -y"
- name: Install buildEssential
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installBuildEssential"
script: "sudo apt-get install build-essential -y"
- name: Install nlohmann json
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installNlohmannJson"
script: "sudo apt-get install nlohmann-json3-dev -y"
- name: Install sqlite3
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSqlite3"
script: "sudo apt-get install sqlite3 -y"
- name: Install sqlite3 dev
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSqlite3Dev"
script: "sudo apt-get install libsqlite3-dev -y"
- name: Install CMake
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installCMake"
script: "sudo apt-get install cmake -y"
- name: Clone Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cloneAzureDcap"
script: "sudo git clone -b $branchName https://github.com/microsoft/Azure-DCAP-Client.git /AzureDCAP"
- name: Update DCAP submodule
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "updateSubmodule"
script: "cd /AzureDCAP && sudo git submodule update --init --recursive"
- name: Configure Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "configureAzureDcap"
script: "cd /AzureDCAP/src/Linux && sudo ./configure"
- name: Make Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeAzureDcap"
script: "cd /AzureDCAP/src/Linux && sudo make"
- name: Clone openenclave
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cloneOpenEnclave"
script: "sudo git clone --recursive https://github.com/openenclave/openenclave.git /openenclave"
- name: Update openenclave submodule
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "updateOpenEnclaveSubmodule"
script: "mkdir /openenclave/build && cd /openenclave/build && sudo git submodule update --recursive --init"
- name: Install Ansible
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installAnsible"
script: "cd /openenclave && sudo scripts/ansible/install-ansible.sh"
- name: Setup ACC
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "setupACC"
script: "cd /openenclave && sudo ansible-playbook scripts/ansible/oe-contributors-acc-setup.yml"
- name: CMake openenclave with ninja
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cmakeOpenEnclave"
script: "cd /openenclave/build && sudo cmake /openenclave -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.buildType }}"
- name: Make openenclave with ninja
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeOpenEnclave"
script: "cd /openenclave/build && sudo ninja -v"
- name: Run openenclave tests excluding samples test
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "testOpenEnclave"
script: "export AZDCAP_REGION_URL=\"thimt2-dev-cbn01p\" && export AZDCAP_BASE_CERT_URL_TDX=\".thim.azure-test.net/sgx/certification\" && cd /openenclave/build && LD_LIBRARY_PATH=/AzureDCAP/src/Linux ctest --output-on-failure -E samples"
- name: Run openenclave samples test
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "testOpenEnclaveSamples"
script: "cd /openenclave/build && sudo LD_LIBRARY_PATH=/AzureDCAP/src/Linux ctest --output-on-failure -R samples"
- name: If the build fails, keep the VM alive for 4 hours for debugging purposes
if: failure()
run: sleep 4h
- name: Cleanup
if: always()
uses: azure/CLI@v2
with:
inlineScript: |
az vm delete \
-g $rgName \
-n $vmName \
--yes
az resource delete \
-g $rgName \
-n ${{ env.vmName }}NSG \
--resource-type "Microsoft.Network/networkSecurityGroups"
az resource delete \
-g $rgName \
-n ${{ env.vmName }}PublicIP \
--resource-type "Microsoft.Network/publicIPAddresses"
# Test DCAP build process in Windows
DCAPWindowsBuildTest:
strategy:
# Launch a VM and build once per each buildType
# Since we only have one persistent VM to perform the windows jobs, max-parallel should always be one.
max-parallel: 1
matrix:
buildType: [Release, Debug]
# OS of the Github VM calling Azure CLI
runs-on: ubuntu-latest
# Job environment variables
env:
os: windows
#Windows VM name must be within 15 characters
vmName: winBuildPers
rgName: dcap-github-actions-agents-rg
location: northeurope
branchName: ${{ github.head_ref }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Start VM
uses: azure/CLI@v2
with:
inlineScript: |
az vm start \
--resource-group $rgName \
--name $vmName
- name: Sleep to let the VM start
run: sleep 60
- name: Clone the DCAP repo after cleaning up the previous execution
uses: azure/CLI@v2
with:
inlineScript: |
az vm run-command create \
--resource-group $rgName \
--vm-name $vmName \
--location $location \
--name "cloneDcap" \
--script "C:/dcapBuild/DCAPCloneMain.ps1 -repo https://github.com/microsoft/Azure-DCAP-Client.git -branch $branchName"
- name: Get the result of cloning the repository
shell: bash
run: |
result=$(az vm run-command show --resource-group $rgName --vm-name $vmName --name "cloneDcap" --instance-view)
echo -e "$result"
if [[ "$result" == *"DCAP_Build_Step_Successfully_Completed"* ]]; then echo "Step successfully executed"; else exit 1; fi
- name: Build Azure DCAP
uses: azure/CLI@v2
with:
inlineScript: |
az vm run-command create \
--resource-group $rgName \
--vm-name $vmName \
--location $location \
--name "buildDcap" \
--script "C:/dcapBuild/DCAPBuildMain.ps1 -BuildType ${{ matrix.buildType }}"
- name: Get the result of building dcap
shell: bash
run: |
result=$(az vm run-command show --resource-group $rgName --vm-name $vmName --name "buildDcap" --instance-view)
echo -e "$result"
if [[ "$result" == *"DCAP_Build_Step_Successfully_Completed"* ]]; then echo "Step successfully executed"; else exit 1; fi
- name: Run Azure DCAP unit tests
uses: azure/CLI@v2
with:
inlineScript: |
az vm run-command create \
--resource-group $rgName \
--vm-name $vmName \
--location $location \
--name "unitTestDcap" \
--script "C:/dcapBuild/DCAPUnitTestsMain.ps1 -BuildType ${{ matrix.buildType }}"
- name: Get the result of the unit tests
shell: bash
run: |
result=$(az vm run-command show --resource-group $rgName --vm-name $vmName --name "unitTestDcap" --instance-view)
echo -e "$result"
if [[ "$result" == *"DCAP_Build_Step_Successfully_Completed"* ]]; then echo "Step successfully executed"; else exit 1; fi
- name: Stop VM
if: always()
uses: azure/CLI@v2
with:
inlineScript: |
az vm deallocate \
--resource-group $rgName \
--name $vmName
# This job runs DCAP end to end tests
DCAPE2ETest:
strategy:
# Launch a VM and build once per each combination of linux image, VM size and buildType
max-parallel: 1
matrix:
sizeName: [CoffeeLake]
imageName: ["Ubuntu20_04"]
include:
- imageUrn: "Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest"
imageName: Ubuntu20_04
- sizeName: CoffeeLake
size: Standard_DC4s_v2
location: westus
# OS of the Github VM calling Azure CLI
runs-on: ubuntu-latest
# Job environment variables
env:
os: linux
vmName: dcapE2ETestBuildVM${{ github.run_number }}${{ matrix.sizeName }}${{ matrix.imageName }}
rgName: dcap-github-actions-agents-rg
branchName: ${{ github.head_ref }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Create VM
uses: azure/CLI@v2
with:
inlineScript: |
az vm create \
--resource-group $rgName \
--name $vmName \
--image ${{ matrix.imageUrn }} \
--size ${{ matrix.size }} \
--location ${{ matrix.location }} \
--admin-username ${{ secrets.BUILD_VM_USERNAME }} \
--admin-password ${{ secrets.BUILD_VM_PASSWORD }} \
--nic-delete-option delete \
--os-disk-delete-option delete \
--public-ip-sku Standard
- name: Sleep to let the VM start
run: sleep 60
- name: Update apt-get
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "updateAptGet"
script: "sudo apt-get update -y"
- name: Install libSSL
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installLibSSL"
script: "sudo apt-get install libssl-dev -y"
- name: Install openSSL
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installOpenSSL"
script: "sudo apt install libcurl4-openssl-dev -y"
- name: Install PkgConfig
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installPkgConfig"
script: "sudo apt-get install pkg-config -y"
- name: Install buildEssential
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installBuildEssential"
script: "sudo apt install build-essential -y"
- name: Install nlohmann json
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installNlohmannJson"
script: "sudo apt-get install nlohmann-json3-dev -y"
- name: Install sqlite3
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSqlite3"
script: "sudo apt-get install sqlite3 -y"
- name: Install sqlite3 dev
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSqlite3Dev"
script: "sudo apt-get install libsqlite3-dev -y"
- name: Install libgtest
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installLibgtest"
script: "sudo apt-get install libgtest-dev -y"
- name: Install CMake
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installCMake"
script: "sudo apt-get install cmake -y"
- name: Install Google test
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installGoogleTest"
script: "cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && cd lib && sudo cp *.a /usr/lib"
- name: Clone Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cloneAzureDcap"
script: "git clone -b $branchName https://github.com/microsoft/Azure-DCAP-Client.git /AzureDCAP"
- name: Update submodule
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "updateSubmodule"
script: "cd /AzureDCAP && git submodule update --init --recursive"
- name: Configure Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "configureAzureDcap"
script: "cd /AzureDCAP/src/Linux && ./configure"
- name: Make Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeAzureDcap"
script: "cd /AzureDCAP/src/Linux && make"
- name: Make Install Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeInstallAzureDcap"
script: "cd /AzureDCAP/src/Linux && sudo make install"
- name: CMake DCAP tests
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cmakeDcapTests"
script: "cd /AzureDCAP/src/Linux && cmake CMakeLists.txt"
- name: Make DCAP tests
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeDcapTests"
script: "cd /AzureDCAP/src/ && sudo cp sgx_ql_lib_common.h /usr/include/ && cd /AzureDCAP/src/Linux/ext/intel/ && sudo cp * /usr/include/ && cd ../.. && make"
- name: Run DCAP tests
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "runDcapTests"
script: "cd /AzureDCAP/src/Linux && sudo /sbin/ldconfig -v && ./dcap_provider_utests"
- name: If the build fails, keep the VM alive for 4 hours for debugging purposes
if: failure()
run: sleep 4h
- name: Cleanup
if: always()
uses: azure/CLI@v2
with:
inlineScript: |
az vm delete \
-g $rgName \
-n $vmName \
--yes
az resource delete \
-g $rgName \
-n ${{ env.vmName }}NSG \
--resource-type "Microsoft.Network/networkSecurityGroups"
az resource delete \
-g $rgName \
-n ${{ env.vmName }}PublicIP \
--resource-type "Microsoft.Network/publicIPAddresses"
# This job runs DCAP end to end tests
# Mariner is based on Fedora and requires different commands from Ubuntu
MarinerBuild:
strategy:
# Launch a VM and build once per each combination of linux image, VM size and buildType
max-parallel: 1
matrix:
sizeName: [CoffeeLake]
imageName: ["Mariner"]
buildType: [RelWithDebInfo, Debug]
include:
- imageUrn: "MicrosoftCBLMariner:cbl-mariner:cbl-mariner-2-gen2:latest"
imageName: Mariner
- sizeName: CoffeeLake
size: Standard_DC4s_v2
location: uksouth
# OS of the Github VM calling Azure CLI
runs-on: ubuntu-latest
# Job environment variables
env:
os: linux
vmName: dcapACCTestBuildVM${{ github.run_number }}${{ matrix.imageName }}${{ matrix.buildType }}
rgName: dcap-github-actions-agents-rg
branchName: ${{ github.head_ref }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Create VM
uses: azure/CLI@v2
with:
inlineScript: |
az vm create \
--resource-group $rgName \
--name $vmName \
--image ${{ matrix.imageUrn }} \
--size ${{ matrix.size }} \
--location ${{ matrix.location }} \
--admin-username ${{ secrets.BUILD_VM_USERNAME }} \
--admin-password ${{ secrets.BUILD_VM_PASSWORD }} \
--nic-delete-option delete \
--os-disk-delete-option delete \
--public-ip-sku Standard \
--os-disk-size-gb 10
- name: Sleep to let the VM start
run: sleep 60
- name: Update packages through dnf
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "dnfUpgrade"
script: "sudo dnf upgrade -y"
- name: Install kernel devel, automake, glibc, glibc-devel and libSSL
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installPrerequisites1"
script: "sudo dnf install kernel-devel -y && sudo dnf install automake -y && sudo dnf install glibc -y && sudo dnf install glibc-devel -y && sudo dnf install openssl-devel -y"
- name: Install openSSL
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installOpenSSL"
script: "sudo dnf install libcurl-devel -y"
- name: Install PkgConfig
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installPkgConfig"
script: "sudo dnf install pkg-config -y"
- name: Install nlohmann json
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installNlohmannJson"
script: "sudo dnf install nlohmann-json-devel -y"
- name: Install sqlite3
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSqlite3"
script: "sudo dnf install sqlite -y"
- name: Install sqlite3 dev
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installSqlite3Dev"
script: "sudo dnf install sqlite-devel -y"
- name: Install git
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installGit"
script: "sudo dnf install git -y"
- name: Install CMake
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installCMake"
script: "sudo dnf install cmake -y"
- name: Install kernel-headers
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installKernelHeaders"
script: 'sudo dnf install kernel-headers -y'
- name: Install binutils
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "installBinutils"
script: 'sudo dnf install binutils -y'
- name: Clone GoogleTest
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cloneGoogleTest"
script: 'sudo git clone https://github.com/google/googletest.git /GoogleTest'
- name: CMake GoogleTest
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cmakeGoogleTest"
script: "cd /GoogleTest && sudo mkdir build && cd build && sudo cmake .."
- name: Make GoogleTest
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeGoogleTest"
script: "cd /GoogleTest/build && sudo make"
- name: Make Install GoogleTest
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeInstallGoogleTest"
script: "cd /GoogleTest/build && sudo make install"
- name: Clone Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cloneAzureDcap"
script: "sudo git clone -b $branchName https://github.com/microsoft/Azure-DCAP-Client.git /AzureDCAP"
- name: Update DCAP submodule
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "updateSubmodule"
script: "cd /AzureDCAP && sudo git submodule update --init --recursive"
- name: Configure Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "configureAzureDcap"
script: "cd /AzureDCAP/src/Linux && sudo ./configure"
- name: Make Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeAzureDcap"
script: "cd /AzureDCAP/src/Linux && sudo make"
- name: Make Install Azure DCAP
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeInstallAzureDcap"
script: "cd /AzureDCAP/src/Linux && sudo make install"
- name: CMake DCAP tests
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "cmakeDcapTests"
script: "cd /AzureDCAP/src/Linux && cmake CMakeLists.txt"
- name: Make DCAP tests
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "makeDcapTests"
script: "cd /AzureDCAP/src/ && sudo cp sgx_ql_lib_common.h /usr/include/ && cd /AzureDCAP/src/Linux/ext/intel/ && sudo cp * /usr/include/ && cd ../.. && make"
- name: Run DCAP tests
uses: ./.github/actions/actionAzVmRunCommand
with:
commandName: "runDcapTests"
script: "cd /AzureDCAP/src/Linux && sudo /sbin/ldconfig -v && ./dcap_provider_utests"
- name: If the build fails, keep the VM alive for 4 hours for debugging purposes
if: failure()
run: sleep 4h
- name: Cleanup
if: always()
uses: azure/CLI@v2
with:
inlineScript: |
az vm delete \
-g $rgName \
-n $vmName \
--yes
az resource delete \
-g $rgName \
-n ${{ env.vmName }}NSG \
--resource-type "Microsoft.Network/networkSecurityGroups"
az resource delete \
-g $rgName \
-n ${{ env.vmName }}PublicIP \
--resource-type "Microsoft.Network/publicIPAddresses"