forked from stripe/stripe-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
74 lines (62 loc) · 3.42 KB
/
appveyor.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
version: 35.17.0.{build}
image: Visual Studio 2019
environment:
COVERALLS_REPO_TOKEN:
secure: T0PmP8uyzCseacBCDRBlti2y9Tz5DL6fknea0MKWvbPYrzADmLY2/5kOTfYIsPUk
# If you bump this, don't forget to bump `MinimumMockVersion` in `StripeMockFixture.cs` as well.
STRIPE_MOCK_VERSION: 0.86.0
deploy:
- provider: NuGet
api_key:
secure: uqwi9JhNCLRscQzn7n4Ugb5KzsIfcH2cnFC50kKLUII+RhP8NRyVG87qbHe9/KIz
on:
appveyor_repo_tag: true
cache:
- stripe-mock -> appveyor.yml
install:
- ps: |
If(!(Test-Path ".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}"))
{
New-Item -Name ".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}" -ItemType "directory" -Force | Out-Null
wget "https://github.com/stripe/stripe-mock/releases/download/v${env:STRIPE_MOCK_VERSION}/stripe-mock_${env:STRIPE_MOCK_VERSION}_windows_amd64.zip" -OutFile ".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}_windows_amd64.zip"
7z.exe x -y -o".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}" ".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}_windows_amd64.zip" | Out-Null
}
$app = Start-Process -FilePath ".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}\stripe-mock.exe" -ArgumentList "-strict-version-check" -NoNewWindow -PassThru
Write-Host ("stripe-mock running, Id = $($app.Id)`n") -ForegroundColor Green
$env:PATH += ";" + (Get-Item -Path ".\stripe-mock\stripe-mock_${env:STRIPE_MOCK_VERSION}").FullName
- dotnet tool install coveralls.net --version 1.0.0 --tool-path tools
before_build:
- ps: Write-Host $("`n HOST INFORMATION `n") -BackgroundColor DarkCyan
- dotnet --info
- ps: Write-Host $("`n RESTORING PACKAGES FOR ALL FRAMEWORKS `n") -BackgroundColor DarkCyan
- dotnet restore src\
build:
parallel: true
build_script:
- ps: Write-Host $("`n BUILDING EVERYTHING `n") -BackgroundColor DarkCyan
- dotnet build src\Stripe.net -c Release /p:ContinuousIntegrationBuild=true
- dotnet build src\Stripe.net -c Debug
- dotnet build src\StripeTests -c Debug
after_build:
- ps: Write-Host $("`n PACKING UP `n") -BackgroundColor DarkCyan
- dotnet pack -c Release src\Stripe.net
test_script:
- ps: Write-Host $("`n RUNNING TESTS `n") -BackgroundColor DarkCyan
- dotnet test src\StripeTests\StripeTests.csproj
after_test:
- ps: Write-Host $("`n RUNNING COVERAGE `n") -BackgroundColor DarkCyan
- dotnet test -c Debug -f netcoreapp3.1 src/StripeTests/StripeTests.csproj --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=CompilerGenerated
- ps: |
# Secure env vars are not available on all branches, so make sure the
# token is available before invoking Coveralls.
if (Test-Path env:COVERALLS_REPO_TOKEN) {
.\tools\csmacnz.Coveralls --opencover -i src/StripeTests/coverage.netcoreapp3.1.opencover.xml --useRelativePaths
}
artifacts:
- path: 'src\Stripe.net\bin\Release\*.nupkg'
# these commands tell appveyor to open an RDP session for debugging
#init:
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
#
#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))