forked from JasperFx/marten
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
204 lines (199 loc) · 6.39 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
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- documentation/*
- .github/*
pr:
- master
resources:
containers:
- container: pg12_plv8
image: ionx/postgres-plv8:12.8
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
NAMEDATALEN: 150
- container: pg15
image: postgres:15-alpine
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
NAMEDATALEN: 150
- container: pgLatest
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
NAMEDATALEN: 150
variables:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
node_version: 16.x
pg_db: marten_testing
CONFIGURATION: Release
FRAMEWORK: net6.0
DISABLE_TEST_PARALLELIZATION: true
CONNECTION_STRING: "Host=localhost;Port=5432;Database=marten_testing;Username=postgres;Password=Password12!;Timeout=60;Cancellation Timeout=5000; Command Timeout=60"
NUKE_TELEMETRY_OPTOUT: true
jobs:
- job: build_dotnet
displayName: build_net6.0
# timeoutInMinutes: 20
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
pg12_plv8:
postgresService: pg12_plv8
serializer: Newtonsoft
plv8: true
pg12_SystemTextJson:
postgresService: pg12_plv8
serializer: SystemTextJson
plv8: true
pg15:
postgresService: pg15
serializer: SystemTextJson
plv8: false
pgLatest:
postgresService: pgLatest
serializer: Newtonsoft
plv8: false
services:
postgres: $[ variables['postgresService'] ]
steps:
- task: UseDotNet@2
displayName: Install .NET 6.0.x
inputs:
packageType: 'sdk'
version: '6.x'
- task: UseDotNet@2
displayName: Install .NET 7.0.x
inputs:
packageType: 'sdk'
version: '7.x'
- task: UseDotNet@2
displayName: Install .NET 8.0.x
inputs:
packageType: 'sdk'
version: '8.x'
- script: |
dotnet workload update
dotnet workload install aspire
displayName: Install .NET Aspire workload
- task: UseNode@1
displayName: Install Node.js
inputs:
version: $(node_version)
- script: |
PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}})
docker exec $PG_CONTAINER_NAME psql -U postgres -c "create database $(pg_db);"
displayName: Create db
- script: |
PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}})
docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfsync = off' >> /var/lib/postgresql/data/postgresql.conf"
docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfull_page_writes = off' >> /var/lib/postgresql/data/postgresql.conf"
docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nsynchronous_commit = off' >> /var/lib/postgresql/data/postgresql.conf"
docker container restart $PG_CONTAINER_NAME
displayName: Optimize database for running tests faster
- script: |
PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}})
docker exec $PG_CONTAINER_NAME psql -U postgres -d $(pg_db) -c "create extension if not exists plv8;"
docker exec $PG_CONTAINER_NAME psql -U postgres -c "DO 'plv8.elog(NOTICE, plv8.version);' LANGUAGE plv8;"
displayName: Add plv8 extension
condition: eq(variables['plv8'], 'true')
- script: ./build.sh compile
displayName: compile
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh mocha
displayName: mocha
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-base-lib
displayName: test-base-lib
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-core
displayName: test-core
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-document-db
displayName: test-document-db
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-event-sourcing
displayName: test-event-sourcing
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-cli
displayName: test-cli
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-core
displayName: test-core
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-linq
displayName: test-linq
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
# - script: ./build.sh test-multi-tenancy
# displayName: test-multi-tenancy
# continueOnError: true
# env:
# DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-patching
displayName: test-patching
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-value-types
displayName: test-value-types
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-code-gen
displayName: test-code-gen
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-noda-time
displayName: test-noda-time
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-aspnet-core
displayName: test-aspnet-core
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
- script: ./build.sh test-plv8
displayName: test-plv8
continueOnError: true
env:
DEFAULT_SERIALIZER: $(serializer)
condition: eq(variables['plv8'], 'true')
# This step will fail the job if the any previous step had failed
- script: |
if [ $(Agent.JobStatus) == 'SucceededWithIssues' ]; then
exit 1
fi
name: CheckForFailure
condition: always()