forked from rakudo/rakudo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
786 lines (706 loc) · 31.5 KB
/
azure-pipelines.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
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# This is the Azure Pipelines configuration is also used to create the
# precompiled release archives that are made available at <https://rakudo.org>.
#
# To trigger a build, go to <https://dev.azure.com/infra0037/raku/...> and
# manually start a run of this pipeline.
#
# The following pipeline variables are required:
#
# BUILD_PRECOMP_RELEASE: Set this to "yes".
# RELEASE_URL: Release archive to build. e.g. "https://rakudo.org/dl/rakudo/rakudo-2020.05.tar.gz"
# VERSION: The version that you are building. e.g. "2020.05"
# REVISION: Usually "01"
#
trigger:
- main
pr:
- main
variables:
system.debug: 'true'
# Turn this Powershell console into a developer powershell console.
# https://intellitect.com/enter-vsdevshell-powershell/
PWSH_DEV: |
$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath
$devShellLoadedSuccess = $false
if (Test-Path -Path ../where_is_devshell/here.txt -PathType leaf) {
$tryDevShell = Get-Item -Path ../where_is_devshell/here.txt | Get-Content -Head 1
if (Test-Path -Path $tryDevShell) {
try {
Import-Module $tryDevShell
$devShell = $tryDevShell
$devShellLoadedSuccess = $true
Write-Output "Successfully loaded DevShell.dll from $tryDevShell"
}
catch {
Write-Output "##[warning]While trying to load the devShell module from $tryDevShell"
Write-Output $_
}
}
}
if (-not $devShellLoadedSuccess) {
Write-Output "Locating DevShell.dll in visual studio installation, please hold on ..."
$devShell = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll
Write-Output "Found DevShell.dll at $devShell"
try {
mkdir ../where_is_devshell/
$devShell | out-file -filepath ../where_is_devshell/here.txt
}
catch {
Write-Output "##[warning]Couldn't cache $devShell in ../where_is_devshell/here.txt :("
Write-Output $_
}
Import-Module $devShell
}
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64"
RAKUDO_CHECKOUT_TYPE: "rev-$(Build.SourceVersion)-selfrepo"
NQP_CHECKOUT_TYPE: downstream
MOAR_CHECKOUT_TYPE: downstream
parameters:
- name: build_backends
type: object
default: ['JVM', 'MVM']
- name: test_backends
type: object
default: ['MVM']
- name: oses
type: object
default: ['Win', 'Lin', 'Mac']
- name: variants
type: object
default:
JVM:
Win: ['']
Lin: ['']
Mac: ['']
MVM:
Win: ['relocatable', '']
Lin: ['relocatable', '']
Mac: ['']
- name: test_variants
type: object
default:
MVM:
Win: ['']
Lin: ['']
Mac: ['']
stages:
- ${{ each os in parameters.oses }}:
- stage: Builds_${{ os }}
dependsOn: []
condition: ne( variables['BUILD_PRECOMP_RELEASE'], 'yes' )
jobs:
- ${{ each backend in parameters.build_backends }}:
- ${{ each variant in parameters['variants'][backend][os] }}:
- job: ${{ os }}_${{ backend }}_${{ coalesce(variant, 'normal') }}
variables:
- name: BACKEND
value: ${{ backend }}
- name: os
value: ${{ os }}
- name: VARIANT
value: ${{ variant }}
- name: RELOCATABLE
${{ if or( eq(variant, 'relocatable'), eq(variant, 'fullspectest') ) }}:
value: "yes"
${{ if and( ne(variant, 'relocatable'), ne(variant, 'fullspectest') ) }}:
value: ""
- name: SPECTEST_ONLY
${{ if eq(variant, 'fullspectest') }}:
value: "yes"
${{ if ne(variant, 'fullspectest') }}:
value: ""
- ${{ if eq(backend, 'JVM') }}:
- name: NQP_OPTIONS
value: '--backends=jvm'
- name: RAKUDO_OPTIONS
value: '--backends=jvm'
- name: MOAR_OPTIONS
value: '--no-moar'
- name: MOAR_CHECKOUT_TYPE
value: 'none'
- ${{ if and( eq(backend, 'MVM'), eq(variant, 'relocatable') ) }}:
- name: NQP_OPTIONS
value: '--backends=moar --relocatable'
- name: RAKUDO_OPTIONS
value: '--backends=moar --relocatable'
- name: MOAR_OPTIONS
value: '--relocatable'
- ${{ if and( eq(backend, 'MVM'), ne(variant, 'relocatable') ) }}:
- name: NQP_OPTIONS
value: '--backends=moar'
- name: RAKUDO_OPTIONS
value: '--backends=moar'
- name: MOAR_OPTIONS
value: ''
- ${{ if eq(os, 'Win') }}:
- name: IMAGE_NAME
value: 'windows-2022'
- name: IS_WIN
value: true
- ${{ if eq(os, 'Lin') }}:
- name: IMAGE_NAME
value: 'ubuntu-24.04'
- name: IS_WIN
value: false
- ${{ if eq(os, 'Mac') }}:
- name: IMAGE_NAME
value: 'macOS-15'
- name: IS_WIN
value: false
pool:
vmImage: $(IMAGE_NAME)
workspace:
clean: all
timeoutInMinutes: 180
steps:
- ${{ if eq(os, 'Win') }}:
- pwsh: |
# Windows has a maximum PATH variable length of 2048 (depending on
# how it's accessed). The length of PATH in AzureCI is already
# really tight. We'll run into the limit when we add Java and the
# MS BuildTools to the path.
# To work around this, we remove a bunch of stuff we won't need
# from PATH here.
$shortened_path = "$(PATH)" -replace ';[^;]*(SeleniumWebDrivers|SQL Server|Mercurial|Amazon|mysql|\\sbt\\|NSIS|Windows Performance Toolkit|php|Subversion)[^;]*(?=(;|$))', ''
echo "##vso[task.setvariable variable=PATH]$shortened_path"
displayName: "Shorten PATH on Windows"
- pwsh: |
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)\bin;$(PATH)"
displayName: "Set java version (Windows)"
enabled: ${{ eq(backend, 'JVM') }}
- ${{ if and(ne(os, 'Win'), eq(backend, 'JVM')) }}:
- script: |
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)/bin:$(PATH)"
displayName: "Set java version (non-Windows)"
- checkout: self
path: selfrepo
displayName: Checkout script repo
fetchDepth: 200
- bash: |
export IS_AZURE_PIPELINES_BUILD=1
echo "##[task.setvariable variable=IS_AZURE_PIPELINES_BUILD]1"
displayName: "set IS_AZURE_PIPELINES_BUILD to 1"
- script: perl selfrepo/tools/build/checkout-repos-for-test.pl $(RAKUDO_CHECKOUT_TYPE) $(NQP_CHECKOUT_TYPE) $(MOAR_CHECKOUT_TYPE)
workingDirectory: $(Pipeline.Workspace)
displayName: Checkout repositories
- ${{ if eq(os, 'Win') }}:
- task: Cache@2
displayName: "load cached location of devshell dll"
inputs:
key: '"where is devshell on" | "$(IMAGE_NAME)"'
path: ../where_is_devshell/
- ${{ if ne(backend, 'JVM') }}:
- bash: |
MOAR_REV=$(cd MoarVM; git describe --always)
echo "##vso[task.setvariable variable=moar_git_rev]"$MOAR_REV
echo moarvm repository has $MOAR_REV checked out
NQP_REV=$(cd nqp; git describe --always)
echo "##vso[task.setvariable variable=nqp_git_rev]"$NQP_REV
echo nqp repository has $NQP_REV checked out
displayName: "Get moar & nqp revision"
workingDirectory: '$(Pipeline.Workspace)/'
- ${{ if eq(backend, 'JVM') }}:
- bash: |
NQP_REV=$(cd nqp; git describe --always)
echo "##vso[task.setvariable variable=nqp_git_rev]"$NQP_REV
echo nqp repository has $NQP_REV checked out
displayName: "Get nqp revision (jvm)"
workingDirectory: '$(Pipeline.Workspace)/'
- task: Cache@2
displayName: "load cached NQP-m & moar"
inputs:
key: 'v3 | "$(BACKEND)" | "$(MOAR_CHECKOUT_TYPE)" | "$(MOAR_OPTIONS)" | "$(IMAGE_NAME)" | "$(moar_git_rev) + $(nqp_git_rev)" | "$(NQP_CHECKOUT_TYPE)" | "$(NQP_OPTIONS)"'
path: ../install-nqp-and-moar
cacheHitVar: NQP_CACHE_RESTORED
- bash: |
mkdir ../install
cp -r ../install-nqp-and-moar/* ../install/
displayName: "extract nqp-and-moar cache"
condition: eq( variables['NQP_CACHE_RESTORED'], 'true' )
- ${{ if ne(backend, 'JVM') }}:
- task: Cache@2
displayName: "load cached moarvm"
inputs:
key: 'v4 | "$(MOAR_CHECKOUT_TYPE)" | "$(MOAR_OPTIONS)" | "$(IMAGE_NAME)" | "$(moar_git_rev)"'
path: ../install-moar
cacheHitVar: MOARVM_CACHE_RESTORED
condition: ne( variables['NQP_CACHE_RESTORED'], 'true' )
- bash: |
mkdir ../install
cp -r ../install-moar/* ../install/
displayName: "extract moar cache"
condition: eq( variables['MOARVM_CACHE_RESTORED'], 'true' )
- ${{ if ne(backend, 'JVM') }}:
# Build MoarVM
- ${{ if ne(os, 'Win') }}:
- script: |
perl Configure.pl --prefix=$(Pipeline.Workspace)/install $(MOAR_OPTIONS)
make install -j3 && \
cp -r ../install ../install-moar
workingDirectory: '$(Pipeline.Workspace)/MoarVM'
condition: and(succeeded(), ne( variables['MOARVM_CACHE_RESTORED'], 'true' ), ne( variables['NQP_CACHE_RESTORED'], 'true' ) )
displayName: Build MoarVM
- ${{ if eq(os, 'Win') }}:
- pwsh: |
${{ variables.PWSH_DEV }}
perl Configure.pl --prefix=$(Pipeline.Workspace)\install $(MOAR_OPTIONS)
nmake install && cp -r ../install ../install-moar
failOnStderr: false
workingDirectory: '$(Pipeline.Workspace)/MoarVM'
condition: and(succeeded(), ne( variables['MOARVM_CACHE_RESTORED'], 'true' ), ne( variables['NQP_CACHE_RESTORED'], 'true' ) )
displayName: Build MoarVM (Windows)
# Build NQP
- ${{ if ne(os, 'Win') }}:
- script: |
perl Configure.pl --no-silent-build --prefix=$(Pipeline.Workspace)/install $(NQP_OPTIONS)
make install -j3 && \
cp -r ../install ../install-nqp-and-moar
workingDirectory: '$(Pipeline.Workspace)/nqp'
condition: and(succeeded(), ne( variables['NQP_CACHE_RESTORED'], 'true') )
displayName: Build NQP
- ${{ if eq(os, 'Win') }}:
- pwsh: |
${{ variables.PWSH_DEV }}
perl Configure.pl --no-silent-build --prefix=$(Pipeline.Workspace)\install $(NQP_OPTIONS)
nmake install && cp -r ../install ../install-nqp-and-moar
failOnStderr: false
workingDirectory: '$(Pipeline.Workspace)/nqp'
condition: and(succeeded(), ne( variables['NQP_CACHE_RESTORED'], 'true'))
displayName: Build NQP (Windows)
- ${{ if ne( backend, 'JVM' ) }}:
# Build Rakudo
- ${{ if ne(os, 'Win') }}:
- script: |
perl Configure.pl --no-silent-build --prefix=$(Pipeline.Workspace)/install $(RAKUDO_OPTIONS)
make install -j3
workingDirectory: '$(Pipeline.Workspace)/rakudo'
displayName: Build Rakudo
- ${{ if eq(os, 'Win') }}:
- pwsh: |
${{ variables.PWSH_DEV }}
perl Configure.pl --no-silent-build --prefix=$(Pipeline.Workspace)\install $(RAKUDO_OPTIONS)
nmake install
failOnStderr: false
workingDirectory: '$(Pipeline.Workspace)/rakudo'
displayName: Build Rakudo (Windows)
- ${{ if eq(variant, 'relocatable') }}:
# TODO: Should use "install moved" instead of "install-moved". But `prove` currently fails with an executable path that contains a space.
- script: mv install install-moved
workingDirectory: $(Pipeline.Workspace)
displayName: Move installation
- task: PublishPipelineArtifact@1
displayName: publish artifact
inputs:
${{ if eq(variant, 'relocatable') }}:
targetPath: $(Pipeline.Workspace)/install-moved
${{ if ne(variant, 'relocatable') }}:
targetPath: $(Pipeline.Workspace)/install
artifact: ${{ backend }}_${{ coalesce(variant, 'normal') }}_${{ os }}
publishLocation: 'pipeline'
#- ${{ if ne(os, 'Win') }}:
# - script: |
# make clean
# workingDirectory: '$(Pipeline.Workspace)/rakudo'
# displayName: Clean build dir
#- ${{ if eq(os, 'Win') }}:
# - pwsh: |
# ${{ variables.PWSH_DEV }}
# nmake clean
# failOnStderr: false
# workingDirectory: '$(Pipeline.Workspace)/rakudo'
# displayName: Build Rakudo (Windows)
- task: PublishPipelineArtifact@1
displayName: publish build folder
inputs:
targetPath: $(Pipeline.Workspace)/rakudo
artifact: ${{ backend }}_sourcecode_built_${{ coalesce(variant, 'normal') }}_${{ os }}
publishLocation: 'pipeline'
- ${{ each os in parameters.oses }}:
- stage: Tests_${{ os }}
dependsOn: Builds_${{ os }}
condition: and( ne( variables['BUILD_PRECOMP_RELEASE'], 'yes' ), succeeded('Builds_${{ os }}') )
jobs:
- ${{ each backend in parameters.test_backends }}:
- ${{ each variant in parameters['test_variants'][backend][os] }}:
- job: ${{ os }}_${{ backend }}_${{ coalesce(variant, 'normal') }}
variables:
- name: BACKEND
value: ${{ backend }}
- name: os
value: ${{ os }}
- name: VARIANT
value: ${{ variant }}
- name: RELOCATABLE
${{ if or( eq(variant, 'relocatable'), eq(variant, 'fullspectest') ) }}:
value: "yes"
${{ if and( ne(variant, 'relocatable'), ne(variant, 'fullspectest') ) }}:
value: ""
- name: SPECTEST_ONLY
${{ if eq(variant, 'fullspectest') }}:
value: "yes"
${{ if ne(variant, 'fullspectest') }}:
value: ""
- ${{ if eq(os, 'Win') }}:
- name: IMAGE_NAME
value: 'windows-2022'
- name: IS_WIN
value: true
- ${{ if eq(os, 'Lin') }}:
- name: IMAGE_NAME
value: 'ubuntu-24.04'
- name: IS_WIN
value: false
- ${{ if eq(os, 'Mac') }}:
- name: IMAGE_NAME
value: 'macOS-15'
- name: IS_WIN
value: false
pool:
vmImage: $(IMAGE_NAME)
workspace:
clean: all
timeoutInMinutes: 180
steps:
- ${{ if eq(os, 'Win') }}:
- pwsh: |
# Windows has a maximum PATH variable length of 2048 (depending on
# how it's accessed). The length of PATH in AzureCI is already
# really tight. We'll run into the limit when we add Java and the
# MS BuildTools to the path.
# To work around this, we remove a bunch of stuff we won't need
# from PATH here.
$shortened_path = "$(PATH)" -replace ';[^;]*(SeleniumWebDrivers|SQL Server|Mercurial|Amazon|mysql|\\sbt\\|NSIS|Windows Performance Toolkit|php|Subversion)[^;]*(?=(;|$))', ''
echo "##vso[task.setvariable variable=PATH]$shortened_path"
displayName: "Shorten PATH on Windows"
- ${{ if eq(os, 'Win') }}:
- task: Cache@2
displayName: "load cached location of devshell dll"
inputs:
key: '"where is devshell on" | "$(IMAGE_NAME)"'
path: ../where_is_devshell/
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)/rakudo'
artifact: ${{ backend }}_sourcecode_built_${{ coalesce(variant, 'normal') }}_${{ os }}
displayName: Download artifact
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
${{ if ne(variant, 'relocatable') }}:
targetPath: '$(Pipeline.Workspace)/install'
${{ if eq(variant, 'relocatable') }}:
targetPath: '$(Pipeline.Workspace)/install-moved'
artifact: ${{ backend }}_${{ coalesce(variant, 'normal') }}_${{ os }}
displayName: Download artifact
- bash: |
export IS_AZURE_PIPELINES_BUILD=1
echo "##[task.setvariable variable=IS_AZURE_PIPELINES_BUILD]1"
displayName: "set IS_AZURE_PIPELINES_BUILD to 1"
- ${{ if eq(os, 'Lin') }}:
- bash: |
curl -L https://cpanmin.us | sudo perl - App::cpanminus --verbose --no-interactive
sudo /usr/local/bin/cpanm --notest TAP::Formatter::JUnit
displayName: install cpanm, TAP::Formatter::JUnit
- ${{ if eq(os, 'Mac') }}:
- bash: |
curl -L https://cpanmin.us | sudo perl - App::cpanminus --verbose --no-interactive
sudo /usr/local/Cellar/perl/5.40.0/bin/cpanm --notest TAP::Formatter::JUnit
displayName: install cpanm, TAP::Formatter::JUnit
- ${{ if eq(os, 'Win') }}:
- pwsh: |
cpanm TAP::Formatter::JUnit
cpanm App::Prove
displayName: install TAP::Formatter::JUnit and App::Prove
- bash: |
echo is azure pipelines build? $IS_AZURE_PIPELINES_BUILD
export TIME_STYLE=full-iso
echo "chmodding the things"
chmod +x install/bin/*
chmod +x install-moved/bin/*
chmod +x install/lib/*
chmod +x install-moved/lib/*
true
workingDirectory: $(Pipeline.Workspace)
displayName: "Fix up permissions so we can execute"
# Test Rakudo
- ${{ if eq(os, 'Win') }}:
- pwsh: |
${{ variables.PWSH_DEV }}
pwd
ls -l .
$Env:PERL_TEST_HARNESS_DUMP_TAP = "test_results"
# TODO: prove fails on this setup when more than a single --ext option is given.
# Thus we only run .t tests, not .rakutest. We'll need to fix this some time.
prove --timer --formatter TAP::Formatter::JUnit -e ..\install\bin\raku --ext .t -vlr t
workingDirectory: '$(Pipeline.Workspace)/rakudo'
enabled: ${{ ne( variant, 'relocatable' ) }}
displayName: Test Rakudo (Windows)
- pwsh: |
${{ variables.PWSH_DEV }}
pwd
ls -l .
$Env:PERL_TEST_HARNESS_DUMP_TAP = "test_results"
# TODO: prove fails on this setup when more than a single --ext option is given.
# Thus we only run .t tests, not .rakutest. We'll need to fix this some time.
prove --timer --formatter TAP::Formatter::JUnit -e ..\install-moved\bin\raku --ext .t -vlr t
workingDirectory: '$(Pipeline.Workspace)/rakudo'
enabled: ${{ eq( variant, 'relocatable' ) }}
displayName: Test Rakudo (relocated, Windows)
- ${{ if ne(os, 'Win') }}:
- script: |
pwd
ls -l .
env PERL_TEST_HARNESS_DUMP_TAP=test_results prove --merge --timer --formatter TAP::Formatter::JUnit -j3 -e ../install/bin/raku --ext .t --ext .rakutest -vlr t
workingDirectory: '$(Pipeline.Workspace)/rakudo'
enabled: ${{ eq( variant, '' ) }}
displayName: Test Rakudo
- script: |
pwd
ls -l .
env PERL_TEST_HARNESS_DUMP_TAP=test_results prove --merge --timer --formatter TAP::Formatter::JUnit -j3 -e ../install-moved/bin/raku --ext .t --ext .rakutest -vlr t
workingDirectory: '$(Pipeline.Workspace)/rakudo'
enabled: ${{ eq( variant, 'relocatable' ) }}
displayName: Test Rakudo (relocated)
# Run spectest
- ${{ if eq( variant, 'fullspectest' ) }}:
- script: |
pwd
ls -l .
export PERL_TEST_HARNESS_DUMP_TAP=test_results
make PERL_TEST_HARNESS_DUMP_TAP=test_results TEST_JOBS=3 m-spectest
workingDirectory: '$(Pipeline.Workspace)/rakudo'
displayName: Run spectest
- bash: |
echo "making up classnames from filenames"
cat > do_classname_rename.sh <<"EOF"
#!/bin/bash
path=$1
classname=$(echo $path | sed -e 's,^./,,' | tr '/-' '._' | sed -E 's/.rakudo.moar.junit.xml|t.junit.xml|.t.xml|.rakudo.moar.xml//')
sed -i -e 's/testcase /testcase classname="'$classname'" /' $path
EOF
chmod +x do_classname_rename.sh
echo "running the script a bunch"
find . -type f -iname '*.xml' -exec ./do_classname_rename.sh "{}" ";"
workingDirectory: '$(Pipeline.Workspace)/rakudo/test_results/t'
displayName: edit test results files
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
displayName: publish test results files
condition: always()
inputs:
targetPath: $(Pipeline.Workspace)/rakudo/test_results
artifact: "${{ backend }} ${{ coalesce(variant, 'normal') }}_test_results_${{ os }}_$(System.JobAttempt)"
publishLocation: 'pipeline'
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
testResultsFiles: '**/*.xml'
searchFolder: '$(Pipeline.Workspace)/rakudo/test_results'
testRunTitle: "${{ os }} ${{ backend }} ${{ variant }} rakudo tests"
buildPlatform: ${{ os }} ${{ backend }} ${{ variant }}
condition: succeededOrFailed()
- stage: Extra_Moar_Stability_Tests
dependsOn: Builds_Lin
condition: and( ne( variables['BUILD_PRECOMP_RELEASE'], 'yes' ), succeeded('Builds_Lin') )
jobs:
- job: Lin_Spesh_Nodelay
pool:
vmImage: 'ubuntu-24.04'
workspace:
clean: all
timeoutInMinutes: 180
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)/install'
artifactName: MVM_relocatable_Lin
displayName: Download artifact
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)/rakudo'
artifactName: MVM_sourcecode_built_relocatable_Lin
displayName: Download artifact
- bash: |
export IS_AZURE_PIPELINES_BUILD=1
echo "##[task.setvariable variable=IS_AZURE_PIPELINES_BUILD]1"
displayName: "set IS_AZURE_PIPELINES_BUILD to 1"
- bash: |
export TIME_STYLE=full-iso
chmod +x install/bin/*
chmod +x install/lib/*
true
displayName: "Fix up permissions so we can execute"
workingDirectory: '$(Pipeline.Workspace)'
- script: |
make --version
export TIME_STYLE=full-iso
echo "ls -lisah gen/moar/nqp-version ../install/bin/nqp-m gen/moar/main-version.nqp"
ls -lisah gen/moar/nqp-version ../install/bin/nqp-m gen/moar/main-version.nqp
echo "ls -lisah gen/ gen/*"
ls -lisah gen/ gen/*
echo "make --trace --just-print m-spectest"
make --trace --just-print m-spectest
workingDirectory: '$(Pipeline.Workspace)/rakudo'
displayName: tell us why you would rebuild everything
- bash: |
curl -L https://cpanmin.us | sudo perl - App::cpanminus
sudo cpanm --notest TAP::Formatter::JUnit
displayName: install cpanm, TAP::Formatter::JUnit
# turn this line:
# spectest_update: $(SPECTEST_DATA) all
# into this line:
# spectest_update: $(SPECTEST_DATA)
- script: |
echo "removing 'all' dependency from spectest_update target"
sed --in-place=.bak -E 's/^(spectest_update.*) all$/\1/' Makefile
echo "chmod +x the rakudo-m that t/harness5 uses to run tests"
chmod +x rakudo-m
echo "creating test_results folder"
mkdir test_results
echo "making spectest checkout"
make --trace m-testable
export PERL_TEST_HARNESS_DUMP_TAP=test_results
make --trace TEST_JOBS=3 m-spectest
workingDirectory: '$(Pipeline.Workspace)/rakudo'
displayName: spectest with nodelay & blocking
- script: |
echo "listing test results subfolders"
ls -lisah *
echo "listing all inputs"
ls -lisah $(find . -type f -iname '*.t' -o -type f -iname '*.rakudo.moar')
echo "running tap2junit"
echo "converting..."
tap2junit --verbose $(find . -type f -iname '*.t' -o -type f -iname '*.rakudo.moar') || echo "oh no, failed to convert!"
echo "making up classnames from filenames"
cat > do_classname_rename.sh <<"EOF"
#!/bin/bash
path=$1
classname=$(echo $path | sed -e 's,^./,,' | tr '/-' '._' | sed -E 's/.rakudo.moar.junit.xml|t.junit.xml|.t.xml|.rakudo.moar.xml//')
sed -i -e 's/testcase /testcase classname="'$classname'" /' $path
EOF
chmod +x do_classname_rename.sh
echo "running the script a bunch"
find . -type f -iname '*.xml' -exec ./do_classname_rename.sh "{}" ";"
workingDirectory: '$(Pipeline.Workspace)/rakudo/test_results/t/'
displayName: convert tap to junit
condition: succeededOrFailed()
# make --trace TEST_JOBS=3 MVM_SPESH_NODELAY=1 MVM_SPESH_BLOCKING=1 m-spectest
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
testResultsFiles: '**/*.xml'
searchFolder: '$(Pipeline.Workspace)/rakudo/test_results'
testRunTitle: "lin mvm relocatable (not) full spectest with(out) spesh NoDelay"
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
displayName: publish test results files
condition: always()
inputs:
targetPath: $(Pipeline.Workspace)/rakudo/test_results
artifact: "MVM_extra_moar_spesh_relocatable_test_results_Lin_$(System.JobAttempt)"
publishLocation: 'pipeline'
- stage: Build_Precomp_Release
dependsOn: []
condition: eq( variables['BUILD_PRECOMP_RELEASE'], 'yes' )
jobs:
- job: linux
displayName: Linux x86_64 build
pool:
vmImage: 'ubuntu-20.04'
container:
image: centos:7
options: "--name raku-build-container -v /usr/bin/docker:/tmp/docker:ro"
workspace:
clean: all
steps:
- script: |
/tmp/docker exec -t -u 0 raku-build-container sh -c 'sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo'
/tmp/docker exec -t -u 0 raku-build-container sh -c 'sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo'
/tmp/docker exec -t -u 0 raku-build-container sh -c 'sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo'
displayName: Work around mirrorlist.centos.org being discontinued
- script: /tmp/docker exec -t -u 0 raku-build-container sh -c "yum -y update && yum -y install sudo"
displayName: Set up sudo (see https://github.com/microsoft/azure-pipelines-agent/issues/2043)
- checkout: self
path: source
displayName: Checkout repository
- script: $(Agent.BuildDirectory)/source/tools/build/binary-release/build-linux.sh
failOnStderr: false
displayName: Run build script
- publish: rakudo-linux.tar.gz
artifact: rakudo-linux
- job: macos
displayName: MacOS x86_64 build
pool:
vmImage: 'macOS-15'
workspace:
clean: all
steps:
- checkout: self
path: source
- script: $(Agent.BuildDirectory)/source/tools/build/binary-release/build-macos.sh
failOnStderr: false
displayName: Run build script
- publish: rakudo-macos.tar.gz
artifact: rakudo-macos
- job: windows
displayName: Windows x86_64 build
pool:
vmImage: 'windows-2022'
workspace:
clean: all
steps:
- checkout: self
path: source
# Turn this Powershell console into a developer powershell console.
# https://intellitect.com/enter-vsdevshell-powershell/
- pwsh: |
$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath
$devShell = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll
Import-Module $devShell
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64"
$(Agent.BuildDirectory)/source/tools/build/binary-release/build-windows.ps1
failOnStderr: false
displayName: Run build script
- publish: rakudo-win.zip
artifact: rakudo-win
- publish: rakudo-win.msi
artifact: rakudo-win-msi
- job: zip
displayName: Package results
dependsOn:
- linux
- macos
- windows
pool:
vmImage: 'ubuntu-24.04'
workspace:
clean: all
steps:
- checkout: none
- download: current
artifact: rakudo-linux
displayName: Download Linux build artifacts
- download: current
artifact: rakudo-macos
displayName: Download MacOS build artifacts
- download: current
artifact: rakudo-win
displayName: Download Windows binary build
- download: current
artifact: rakudo-win-msi
displayName: Download Windows msi
- script: |
OUT_DIR=rakudo-builds-$(VERSION)-$(REVISION)
mkdir $OUT_DIR
cp $(Pipeline.Workspace)/rakudo-linux/rakudo-linux.tar.gz $OUT_DIR/rakudo-moar-$(VERSION)-$(REVISION)-linux-x86_64-gcc.tar.gz
cp $(Pipeline.Workspace)/rakudo-macos/rakudo-macos.tar.gz $OUT_DIR/rakudo-moar-$(VERSION)-$(REVISION)-macos-x86_64-clang.tar.gz
cp $(Pipeline.Workspace)/rakudo-win/rakudo-win.zip $OUT_DIR/rakudo-moar-$(VERSION)-$(REVISION)-win-x86_64-msvc.zip
cp $(Pipeline.Workspace)/rakudo-win-msi/rakudo-win.msi $OUT_DIR/rakudo-moar-$(VERSION)-$(REVISION)-win-x86_64-msvc.msi
tar -czf rakudo-moar-builds-$(VERSION)-$(REVISION).tar.gz $OUT_DIR
- publish: rakudo-moar-builds-$(VERSION)-$(REVISION).tar.gz
artifact: build-result