forked from forcedotcom/salesforcedx-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
73 lines (64 loc) · 2.46 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
# version format
version: '{branch}-{build}'
# Do not build on tags (GitHub and BitBucket)
skip_tags: true
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
# Build on x64 only
platform: x64
environment:
SFDX_AUTOUPDATE_DISABLE: true
SFDX_DOMAIN_RETRY: 300
install:
- ps: Install-Product node 8 x64
- appveyor-retry npm install
- npm install -g sfdx-cli
- npm install -g codecov
- npm install -g junit-merge
# the JWT key should be stored base 64 encoded in AppVeyor settings. If you change this, it will take a few builds to propogate
- ps: "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($env:SFDX_CI_DEVHUB_JWTKEY)) | Out-File -Encoding \"ASCII\" C:\\projects\\devhub.key"
- sfdx force:auth:jwt:grant --clientid %SFDX_CI_DEVHUB_CLIENTID% --username %SFDX_CI_DEVHUB_USERNAME% --jwtkeyfile C:\projects\devhub.key --setdefaultdevhubusername --setalias devhub
build_script:
- npm run compile
- npm run lint
test_script:
- node --version
- npm --version
- ps: |
#Initialize some variables, move to the project root
$ProjectRoot = $ENV:APPVEYOR_BUILD_FOLDER
Set-Location $ProjectRoot
# Run tests
"`n`n`n`n"
"--------------------------------------------"
"Running npm run test:without-system-tests..."
"--------------------------------------------"
npm run test:without-system-tests
npm run coverage:system-tests
npm run aggregateJUnit
junit-merge -d junit-aggregate -o junit-aggregate.xml
$NpmTestsExitCode = $LastExitCode
# Show status
"`n`n"
"Finalizing results`n"
$AllFiles = Get-ChildItem -Path $ProjectRoot\packages\*\xunit.xml -File | Select -ExpandProperty FullName
"Test Results:`n$($AllFiles | Out-String)"
# Upload results for AppVeyor test tab
"Uploading Test Results:`n"
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)" , (Resolve-Path .\junit-aggregate.xml) )
artifacts:
- path: '**\*.vsix'
- path: junit-aggregate/
name: test-results
type: zip
on_finish:
- del C:\projects\devhub.key
- codecov --disable=gcov
- ps: |
[xml]$results = Get-Content junit-aggregate.xml
$failure = $results.SelectSingleNode("//failure")
if ($failure -ne $null)
{
$host.SetShouldExit(1)
Write-Host "Forcing build failure due to test failure(s) :'("
}