Skip to content

Commit

Permalink
x86 AppVeyor builds
Browse files Browse the repository at this point in the history
This closes arkhipov#16
  • Loading branch information
mlt committed Jun 9, 2016
1 parent 6ec1c4d commit 49f3852
Showing 1 changed file with 60 additions and 38 deletions.
98 changes: 60 additions & 38 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,83 @@ pull_requests:
do_not_increment_build_number: true
os: Visual Studio 2015
configuration: Release
platform: x64
platform:
- x86
- x64
clone_depth: 1
environment:
PG95: postgresql-9.5.0-1-windows-x64.exe
PGUSER: postgres
PGPASSWORD: Password12!
matrix:
- pgversion: 9.3
PlatformToolset: Windows7.1SDK
- pgversion: 9.4
PlatformToolset: v120
- pgversion: 9.5
PlatformToolset: v120

install:
- if not exist %PG95% curl -sLO http://get.enterprisedb.com/postgresql/%PG95%
- if not exist "%PROGRAMFILES%\PostgreSQL\9.5\" if "%pgversion%" == "9.5" (
%PG95% --unattendedmodeui minimal^
--mode unattended^
--superpassword %PGPASSWORD%^
--servicepassword %PGPASSWORD%^
&& net stop postgresql-x64-9.5
- exe: postgresql-9.3.13-1-windows-%PLATFORM%.exe
- exe: postgresql-9.4.8-1-windows-%PLATFORM%.exe
- exe: postgresql-9.5.3-1-windows-%PLATFORM%.exe
- exe: postgresql-9.6.0-beta1-windows-%PLATFORM%.exe

- set dist=%exe:-x86=%
- set pgversion=%exe:~11,3%
- echo pgversion=%pgversion%
- if %PLATFORM%==x64 ( set pf=%ProgramFiles%&& set x64=-x64) else set pf=%ProgramFiles(x86)%
- set pgroot=%pf%\PostgreSQL\%pgversion%
- echo %pgroot%
- if not exist "%pgroot%\bin" (
( if not exist %exe% curl -sL -o %exe% --retry 2 --retry-delay 30 http://get.enterprisedb.com/postgresql/%dist% )
&& %exe% --unattendedmodeui minimal
--mode unattended
--superpassword %PGPASSWORD%
--servicepassword %PGPASSWORD%
&& net stop postgresql%x64%-%pgversion%
)

cache: '%PG95%'
cache: '%exe%'

build_script:
- msbuild /p:PlatformToolset=%PlatformToolset% /p:configuration=Release /p:platform=x64^
temporal_tables.vcxproj^
- if %pgversion%=="9.3" (set PlatformToolset=Windows7.1SDK) else set PlatformToolset=v120
- msbuild /p:PlatformToolset=%PlatformToolset% /p:configuration=%CONFIGURATION% /p:platform=%PLATFORM%
temporal_tables.vcxproj
/verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

test_script:
- set pgbin=%ProgramFiles%\PostgreSQL\%pgversion%\bin
- set PATH=%PATH%;%SystemRoot%\system32;%pgbin%
- path %pgroot%\bin;%PATH%
- set dll=%PLATFORM:x86=.%\%CONFIGURATION%\temporal_tables.dll

- rem Check DLL dependencies.
- C:\msys64\usr\bin\ldd x64\Release\temporal_tables.dll
- appveyor AddMessage Packing -Category Information
- md tmp\share\extension
- copy *.sql tmp\share\extension\
- copy *.control tmp\share\extension\
- copy LICENSE tmp\TEMPORAL_TABLES_LICENSE
- md tmp\lib
- copy %dll% tmp\lib
- set zip=temporal_tables-%APPVEYOR_REPO_COMMIT:~0,8%-pg%pgversion%-%PLATFORM%.zip
- 7z a -r %zip% .\tmp\* > nul

- rem Copy the extension files to the PostgreSQL directories.
- copy /y *.control "%ProgramFiles%\PostgreSQL\%pgversion%\share\extension\"
- copy /y *.sql "%ProgramFiles%\PostgreSQL\%pgversion%\share\extension\"
- copy /y x64\Release\temporal_tables.dll "%ProgramFiles%\PostgreSQL\%pgversion%\lib\"
- appveyor AddMessage "Copying the extension files to the PostgreSQL directories." -Category Information
- 7z x %zip% "-o%pgroot%"

- rem Start the database server.
- net start postgresql-x64-%pgversion%

- rem Run the regression tests tool.
- net start postgresql%x64%-%pgversion%

- rem --psqldir has been replaced by --bindir since 9.5.
- if "%pgversion%"=="9.5" (set psqlopt="--bindir") else (set psqlopt="--psqldir")

- pg_regress "%psqlopt%=%pgbin%"^
install no_system_period invalid_system_period no_history_table^
no_history_system_period invalid_types invalid_system_period_values^
- appveyor AddTest Regression -Framework pg_regress -FileName sql\ -Outcome Running
- if %pgversion:~2,1% LEQ 4 ( set psqlopt=--psqldir) else set psqlopt=--bindir
- pg_regress "%psqlopt%=%pgbin%"
install no_system_period invalid_system_period no_history_table
no_history_system_period invalid_types invalid_system_period_values
versioning versioning_custom_system_time structure uninstall
- if ERRORLEVEL 1 (set Outcome=Failed) else set Outcome=Passed
- perl -e "my @s=stat('regression.out'); print 1000*($s[9]-$s[10]);" > duration
- set /p Duration=< duration
- appveyor UpdateTest Regression -Framework pg_regress -FileName sql\ -Outcome %Outcome% -Duration %Duration%
- if not %Outcome%==Passed type regression.diffs

artifacts:
- path: x64\Release\temporal_tables.dll
- path: '*.zip'

deploy:
# Deploy to GitHub Releases
- provider: GitHub
artifact: /.*\.zip/
draft: false
prerelease: false
on:
branch: master # release from master branch only
appveyor_repo_tag: true # deploy on tag push only

0 comments on commit 49f3852

Please sign in to comment.