forked from JasperFx/marten
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
115 lines (110 loc) · 3.79 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
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:
config: Release
disable_test_parallelization: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
dotnet_version: '8.x'
dotnet_framework_version: 'net8.0'
node_version: 16.x
pg_db: marten_testing
marten_testing_database: "Host=localhost;Port=5432;Database=marten_testing;Username=postgres;Password=Password12!;Timeout=60;Cancellation Timeout=5000; Command Timeout=60"
jobs:
- job: build_dotnet
displayName: Build .NET 8
# 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 8.0.x
inputs:
packageType: 'sdk'
version: $(dotnet_version)
- 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: |
dotnet run --project build/build.csproj -f $(dotnet_framework_version) -c Release -- ci
dotnet run --project build/build.csproj -f $(dotnet_framework_version) -c Release -- test-extension-libs-without-plv8
displayName: Build
env:
DEFAULT_SERIALIZER: $(serializer)
- script: |
dotnet run --project build/build.csproj -f $(dotnet_framework_version) -c Release -- test-plv8
displayName: Build plv8
env:
DEFAULT_SERIALIZER: $(serializer)
condition: eq(variables['plv8'], 'true')