forked from pgjdbc/pgjdbc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathappveyor.yml
More file actions
97 lines (87 loc) · 3.71 KB
/
appveyor.yml
File metadata and controls
97 lines (87 loc) · 3.71 KB
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
# appveyor.yml
image: Visual Studio 2022
configuration: Release
clone_depth: 1
environment:
JAVA_HOME: 'C:\Program Files\Java\jdk21'
matrix:
- pg: 16
# AppVeyor takes ~20 min for running the tests, so testing two PG versions results in slow PR feedback
# It might be worth uncommenting if the tests get faster somehow
# - pg: 11
skip_commits:
files:
- 'docs/**'
- '**/*.md'
- '.github/**'
init:
- set pf=%ProgramFiles%&& set x64=-x64
- set exe=postgresql-%pg%-windows%x64%.exe
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# We expect that Windows would have CRLF for newlines, so autocrlf=true should be used
# to automatically convert text files to CRLF on checkout
- git config --global core.autocrlf true
- mkdir "\Users\appveyor\.gradle
branches:
except:
- /^tmp\/.*/
- /^REL.*/
install:
- for /f "tokens=1 delims=-" %%A in ("%pg%") do set pgversion=%%~nA
- echo pgversion=%pgversion%
- echo pf=%pf%
- set pgroot=%pf%\PostgreSQL\%pgversion%
- echo %pgroot%
- echo service=postgresql%x64%-%pgversion%
before_build:
- ps: Add-Content -PATH "$env:pgroot\data\postgresql.conf" "wal_level=logical"
- ps: Add-Content -PATH "$env:pgroot\data\postgresql.conf" "max_wal_senders=3"
- ps: Add-Content -PATH "$env:pgroot\data\postgresql.conf" "wal_sender_timeout=5s"
- ps: Add-Content -PATH "$env:pgroot\data\postgresql.conf" "max_replication_slots=10"
- ps: |
Copy-Item -Path .\certdir\server\pg_hba.conf -Destination "$env:pgroot\data\pg_hba.conf" -Force
(Get-Content -Raw "$env:pgroot\data\pg_hba.conf") -replace '(?m)^local\b', '#local' | Set-Content "$env:pgroot\data\pg_hba.conf"
# PostgreSQL 11 can't start if ssl=off and pg_hba.conf includes hostssl, so we comment it out as we don't configure ssl yet
(Get-Content -Raw "$env:pgroot\data\pg_hba.conf") -replace '(?m)^hostssl\b', '#hostssl' | Set-Content "$env:pgroot\data\pg_hba.conf"
Write-Host "Here's the contents of pg_hba.conf:"
Get-Content "$env:pgroot\data\pg_hba.conf" | Where-Object { $_ -notmatch '^\s*#' -and $_.Trim() -ne '' }
- ps: |
net start "postgresql$env:x64-$env:pgversion"
if ($LASTEXITCODE -ne 0) {
Select-String -Path "$env:pgroot\data\postgresql.conf" -Pattern "log_directory|logging_collector"
$pgLogDir = "$env:pgroot\data\log"
if (-not (Test-Path $pgLogDir)) {
Write-Host "Log directory does not exist: $pgLogDir"
} else {
$latestLog = Get-ChildItem -Path $pgLogDir -File |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if ($latestLog) {
Write-Host "=== Showing latest PostgreSQL log: $($latestLog.Name) ==="
Get-Content -Path $latestLog.FullName -Tail 100
} else {
Write-Host "No PostgreSQL log files found."
}
}
throw "PostgreSQL did not start, so there's no reason to continue with the tests"
}
- path %pgroot%\bin;%PATH%
- mkdir %APPDATA%\postgresql
- echo *:*:*:postgres:Password12!> %APPDATA%\postgresql\pgpass.conf
- createuser -U postgres test
- psql -U postgres -c "alter user test with password 'test'" postgres
- psql -U postgres -c "alter user test with replication" postgres
- psql -U postgres -c "CREATE EXTENSION sslinfo" postgres
- createuser -U postgres testsspi
- createdb -U postgres -O test test
- createdb -U postgres -O test test_2
- psql -U postgres -c "CREATE EXTENSION hstore" test
- del %APPDATA%\postgresql\pgpass.conf
build_script:
- gradlew assemble
test_script:
- echo redirect escape ^> foo.bar
- echo privilegedPassword=Password12!>c:\projects\pgjdbc\build.local.properties
- gradlew test -PskipReplicationTests
cache:
- C:\Users\appveyor\.m2