|
| 1 | +# for CI with appveyor.yml |
| 2 | +# Ref: http://www.yegor256.com/2015/01/10/windows-appveyor-maven.html |
| 3 | +version: '{branch}-{build}' |
| 4 | +os: Windows Server 2012 |
| 5 | +skip_branch_with_pr: true |
| 6 | +hosts: |
| 7 | + petstore.swagger.io: 127.0.0.1 |
| 8 | +install: |
| 9 | + - ps: | |
| 10 | + Add-Type -AssemblyName System.IO.Compression.FileSystem |
| 11 | + if (!(Test-Path -Path "C:\maven" )) { |
| 12 | + (new-object System.Net.WebClient).DownloadFile( |
| 13 | + 'http://www.us.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip', |
| 14 | + 'C:\maven-bin.zip' |
| 15 | + ) |
| 16 | + [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven") |
| 17 | + } |
| 18 | + - cmd: SET PATH=C:\maven\apache-maven-3.5.4\bin;%JAVA_HOME%\bin;%PATH% |
| 19 | + - cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g |
| 20 | + - cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g |
| 21 | + - cmd: SET M2_HOME=C:\maven\apache-maven-3.5.4 |
| 22 | + - cmd: dir/w |
| 23 | +# - cmd: RMDIR "C:\projects\swagger-codegen\swagger-samples" /S /Q |
| 24 | + - git clone https://github.com/wing328/swagger-samples |
| 25 | + - ps: Start-Process -FilePath 'C:\maven\apache-maven-3.5.4\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci" |
| 26 | +build_script: |
| 27 | + # build C# API client |
| 28 | + - nuget restore samples\client\petstore\csharp\SwaggerClient\IO.Swagger.sln |
| 29 | + - msbuild samples\client\petstore\csharp\SwaggerClient\IO.Swagger.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" |
| 30 | + # build C# API client (with PropertyChanged) |
| 31 | + - nuget restore samples\client\petstore\csharp\SwaggerClientWithPropertyChanged\IO.Swagger.sln |
| 32 | + - msbuild samples\client\petstore\csharp\SwaggerClientWithPropertyChanged\IO.Swagger.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" |
| 33 | + # build C# .net standard 1.3+ API client |
| 34 | + - nuget restore samples\client\petstore\csharp\SwaggerClientNetStandard\IO.Swagger.sln |
| 35 | + - msbuild samples\client\petstore\csharp\SwaggerClientNetStandard\IO.Swagger.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" |
| 36 | + # install swagger codegen locally |
| 37 | + - mvn clean install --batch-mode |
| 38 | +test_script: |
| 39 | + # test c# API client |
| 40 | + - nunit-console samples\client\petstore\csharp\SwaggerClient\src\IO.Swagger.Test\bin\Debug\IO.Swagger.Test.dll --result=myresults.xml;format=AppVeyor |
| 41 | + # test c# API client (with PropertyChanged) |
| 42 | + - nunit-console samples\client\petstore\csharp\SwaggerClientWithPropertyChanged\src\IO.Swagger.Test\bin\Debug\IO.Swagger.Test.dll --result=myresults.xml;format=AppVeyor |
| 43 | + |
| 44 | + # generate all petstore clients |
| 45 | + - .\bin\windows\run-all-petstore.cmd |
| 46 | +#cache: |
| 47 | +# - C:\maven\ |
| 48 | +# - C:\Users\appveyor\.m2 |
0 commit comments