Skip to content

Commit 7fc011a

Browse files
authored
Add more Linux CI jobs to Azure Pipelines build (mono#20851)
Also template-ify it a bit.
1 parent c868a25 commit 7fc011a

File tree

7 files changed

+221
-198
lines changed

7 files changed

+221
-198
lines changed

acceptance-tests/coreclr.mk

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ coreclr-validate:
99
$(MAKE) validate-coreclr RESET_VERSIONS=1
1010

1111
coreclr-compile-tests: coreclr-validate
12-
$(MAKE) -j4 $(CORECLR_TESTSI_CS)
13-
$(MAKE) -j4 $(CORECLR_COREMANGLIB_TESTSI_CS)
14-
$(MAKE) -j4 $(CORECLR_TESTSI_IL)
12+
$(call makeinbatches, $(CORECLR_TESTSI_CS))
13+
$(call makeinbatches, $(CORECLR_COREMANGLIB_TESTSI_CS))
14+
$(call makeinbatches, $(CORECLR_TESTSI_IL))
1515

1616
# the CoreCLR tests rely on the coreclr-testlibrary.dll, we need to copy it to the test directory
1717
coreclr-runtest-basic: coreclr-validate test-runner.exe $(CORECLR_TESTSI_CS) $(CORECLR_TESTSI_IL)
@@ -32,7 +32,7 @@ coreclr-runtest-coremanglib: coreclr-validate test-runner.exe $(CORECLR_COREMANG
3232
check-coreclr: coreclr-compile-tests coreclr-runtest-basic coreclr-runtest-coremanglib
3333

3434
coreclr-gcstress: coreclr-validate GCStressTests.exe $(CORECLR_STRESSTESTSI_CS)
35-
BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/$(if $(CI_PR),testmix_gc_pr.config,testmix_gc.config); if [ $$? -ne 100 ]; then exit 1; fi
35+
BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/testmix_gc_pr.config; if [ $$? -ne 100 ]; then exit 1; fi
3636

3737
# Output a variable in $(2) to the file $(1), separated by newline characters
3838
# we need to do it in groups of 100 entries to make sure we don't exceed shell char limits
@@ -42,6 +42,12 @@ echo $(wordlist 1, 100, $(2)) | tr " " "\n" >> $(1)
4242
$(if $(word 101, $(2)), $(call dumpvariabletofile, $(1), $(wordlist 101, $(words $(2)), $(2))))
4343
endef
4444

45+
# Run make in batches from a list of targets in $(1) to make sure we don't exceed shell char limits
46+
define makeinbatches
47+
$(MAKE) -j4 $(wordlist 1, 100, $(1))
48+
$(if $(word 101, $(1)), $(call makeinbatches, $(wordlist 101, $(words $(1)), $(1))))
49+
endef
50+
4551
CORECLR_TEST_CS_SRC= \
4652
$(CORECLR_PATH)/tests/src/GC/Coverage/LargeObjectAlloc.cs \
4753
$(CORECLR_PATH)/tests/src/GC/Coverage/LargeObjectAlloc2.cs \

mcs/class/Mono.Posix/Test/Mono.Unix/UnixUserTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void ReentrantConstructors ()
8282
[Test]
8383
[Category ("NotOnMac")]
8484
[Category ("AndroidNotWorking")] // setpwent is missing from bionic
85+
[Ignore("Fails on Ubuntu 20.04 on Azure Pipelines")]
8586
public void NonReentrantSyscalls ()
8687
{
8788
ArrayList user_ids = new ArrayList (4);

scripts/ci/mono-ci-job-template.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
parameters:
2+
- name: displayName
3+
type: string
4+
- name: os
5+
type: string
6+
- name: arch
7+
type: string
8+
- name: timeoutInMinutes
9+
type: number
10+
default: 120
11+
- name: publishTestResults
12+
type: boolean
13+
default: true
14+
- name: containerImage
15+
type: string
16+
default: ''
17+
- name: additionalCITags
18+
type: string
19+
default: ''
20+
21+
jobs:
22+
- job:
23+
displayName: ${{ parameters.displayName }}
24+
pool:
25+
${{ if eq(parameters.os, 'osx') }}:
26+
vmImage: macos-10.15
27+
${{ if eq(parameters.os, 'linux') }}:
28+
vmImage: ubuntu-20.04
29+
${{ if and(eq(parameters.os, 'linux'), eq(parameters.arch, 'i386')) }}:
30+
container:
31+
image: i386/ubuntu:20.04
32+
options: --platform linux/386
33+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
34+
steps:
35+
- checkout: self
36+
clean: true
37+
fetchDepth: 10
38+
submodules: recursive
39+
- ${{ if eq(parameters.os, 'osx')}}:
40+
- script: brew install autoconf automake libtool pkg-config cmake python3
41+
displayName: Install dependencies
42+
- ${{ if eq(parameters.os, 'linux')}}:
43+
- script: sudo apt install -y autoconf libtool automake build-essential gettext cmake python3 curl
44+
displayName: Install dependencies
45+
- script: CI_TAGS="${{ parameters.os }}-${{ parameters.arch }},$(pullRequestCITags),${{ parameters.additionalCITags }}" scripts/ci/run-jenkins.sh
46+
displayName: Build and Test
47+
- script: echo "Found unstable steps, please check previous logs for details." && exit 1
48+
displayName: Fail build on unstable steps
49+
condition: eq(variables['BuildHasUnstableSteps'], true)
50+
- task: PublishTestResults@2
51+
condition: and(succeededOrFailed(), eq('${{ parameters.publishTestResults }}', 'true'), not(contains('${{ parameters.additionalCITags }}', 'no-tests')))
52+
inputs:
53+
testRunner: 'NUnit'
54+
testResultsFiles: '**/TestResult*.xml'
55+
testRunTitle: ${{ parameters.displayName }}
56+
failTaskOnFailedTests: true

scripts/ci/mono-ci.yml

+145-53
Original file line numberDiff line numberDiff line change
@@ -39,63 +39,155 @@ pr:
3939
- SECURITY.md
4040
- THIRD-PARTY-NOTICES.TXT
4141

42+
variables:
43+
- name: pullRequestCITags
44+
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
45+
value: 'retry-flaky-tests,pull-request'
46+
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
47+
value: ''
48+
49+
4250
jobs:
4351

4452
#
45-
# Basic build
53+
# Linux x64
54+
#
55+
- template: /scripts/ci/mono-ci-job-template.yml
56+
parameters:
57+
displayName: Linux x64
58+
os: linux
59+
arch: amd64
60+
61+
- template: /scripts/ci/mono-ci-job-template.yml
62+
parameters:
63+
displayName: Linux x64 - prefix sanity checks
64+
os: linux
65+
arch: amd64
66+
additionalCITags: make-install
67+
publishTestResults: false
68+
69+
- template: /scripts/ci/mono-ci-job-template.yml
70+
parameters:
71+
displayName: Linux x64 Acceptance Tests
72+
os: linux
73+
arch: amd64
74+
additionalCITags: acceptance-tests
75+
publishTestResults: false
76+
77+
- template: /scripts/ci/mono-ci-job-template.yml
78+
parameters:
79+
displayName: Linux x64 All Profiles Build
80+
os: linux
81+
arch: amd64
82+
additionalCITags: all-profiles,apidiff,csprojdiff,no-tests
83+
84+
#- template: /scripts/ci/mono-ci-job-template.yml
85+
# parameters:
86+
# displayName: Linux x64 Bitcode
87+
# os: linux
88+
# arch: amd64
89+
# additionalCITags: bitcode
90+
#
91+
#- template: /scripts/ci/mono-ci-job-template.yml
92+
# parameters:
93+
# displayName: Linux x64 Bitcode+Interpreter
94+
# os: linux
95+
# arch: amd64
96+
# additionalCITags: bitcodeinterp
97+
98+
- template: /scripts/ci/mono-ci-job-template.yml
99+
parameters:
100+
displayName: Linux x64 C++
101+
os: linux
102+
arch: amd64
103+
additionalCITags: cxx
104+
105+
- template: /scripts/ci/mono-ci-job-template.yml
106+
parameters:
107+
displayName: Linux x64 Checked Private Types Build
108+
os: linux
109+
arch: amd64
110+
additionalCITags: checked-all,no-tests
111+
112+
- template: /scripts/ci/mono-ci-job-template.yml
113+
parameters:
114+
displayName: Linux x64 Coop Suspend
115+
os: linux
116+
arch: amd64
117+
additionalCITags: coop-suspend,checked-coop
118+
119+
- template: /scripts/ci/mono-ci-job-template.yml
120+
parameters:
121+
displayName: Linux x64 FullAOT
122+
os: linux
123+
arch: amd64
124+
additionalCITags: fullaot
125+
126+
- template: /scripts/ci/mono-ci-job-template.yml
127+
parameters:
128+
displayName: Linux x64 FullAOT+Interpreter
129+
os: linux
130+
arch: amd64
131+
additionalCITags: fullaotinterp
132+
133+
- template: /scripts/ci/mono-ci-job-template.yml
134+
parameters:
135+
displayName: Linux x64 FullAOT+Interpreter+LLVM
136+
os: linux
137+
arch: amd64
138+
additionalCITags: fullaotinterp_llvm
139+
140+
#- template: /scripts/ci/mono-ci-job-template.yml
141+
# parameters:
142+
# displayName: Linux x64 FullAOT+LLVM
143+
# os: linux
144+
# arch: amd64
145+
# additionalCITags: fullaot_llvm
146+
147+
- template: /scripts/ci/mono-ci-job-template.yml
148+
parameters:
149+
displayName: Linux x64 Interpreter
150+
os: linux
151+
arch: amd64
152+
additionalCITags: interpreter
153+
timeoutInMinutes: 180
154+
155+
- template: /scripts/ci/mono-ci-job-template.yml
156+
parameters:
157+
displayName: Linux x64 mcs
158+
os: linux
159+
arch: amd64
160+
additionalCITags: mcs-compiler,no-tests
161+
162+
163+
#
164+
# Linux i386
46165
#
47-
- job:
48-
displayName: Linux x64
49-
pool:
50-
vmImage: ubuntu-20.04
51-
timeoutInMinutes: 120
52-
workspace:
53-
clean: all
54-
steps:
55-
- checkout: self
56-
clean: true
57-
fetchDepth: 10
58-
submodules: recursive
59-
- script: sudo apt install -y autoconf libtool automake build-essential gettext cmake python3 curl
60-
- script: CI_TAGS="linux-amd64,retry-flaky-tests,pull-request" scripts/ci/run-jenkins.sh # TODO: set pull-request CI tag dynamically
61-
- task: PublishTestResults@2
62-
inputs:
63-
testRunner: 'NUnit'
64-
testResultsFiles: '**/TestResult*.xml'
65-
66-
- job:
67-
displayName: OS X x64
68-
pool:
69-
vmImage: macos-10.15
70-
timeoutInMinutes: 120
71-
workspace:
72-
clean: all
73-
steps:
74-
- checkout: self
75-
clean: true
76-
fetchDepth: 10
77-
submodules: recursive
78-
- script: brew install autoconf automake libtool pkg-config cmake python3
79-
- script: CI_TAGS="osx-amd64,retry-flaky-tests,pull-request" scripts/ci/run-jenkins.sh # TODO: set pull-request CI tag dynamically
80-
- task: PublishTestResults@2
81-
inputs:
82-
testRunner: 'NUnit'
83-
testResultsFiles: '**/TestResult*.xml'
166+
#- template: /scripts/ci/mono-ci-job-template.yml
167+
# parameters:
168+
# displayName: Linux i386
169+
# os: linux
170+
# arch: i386
171+
#
172+
#- template: /scripts/ci/mono-ci-job-template.yml
173+
# parameters:
174+
# displayName: Linux i386 Interpreter
175+
# os: linux
176+
# arch: i386
177+
# additionalCITags: interpreter
84178

85179
#
86-
# MCS-only build
180+
# OSX x64
87181
#
88-
- job:
89-
displayName: Linux x64 mcs
90-
pool:
91-
vmImage: ubuntu-20.04
92-
timeoutInMinutes: 120
93-
workspace:
94-
clean: all
95-
steps:
96-
- checkout: self
97-
clean: true
98-
fetchDepth: 10
99-
submodules: recursive
100-
- script: sudo apt install -y autoconf libtool automake build-essential gettext cmake python3 curl
101-
- script: CI_TAGS="linux-amd64,mcs-compiler,no-tests,pull-request" scripts/ci/run-jenkins.sh # TODO: set pull-request CI tag dynamically
182+
- template: /scripts/ci/mono-ci-job-template.yml
183+
parameters:
184+
displayName: OS X x64
185+
os: osx
186+
arch: amd64
187+
188+
- template: /scripts/ci/mono-ci-job-template.yml
189+
parameters:
190+
displayName: OS X x64 C++
191+
os: osx
192+
arch: amd64
193+
additionalCITags: cxx

0 commit comments

Comments
 (0)