75 строки
2.5 KiB
YAML
75 строки
2.5 KiB
YAML
# 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_URL_WINDOWS: https://developer.salesforce.com/media/salesforce-cli/sfdx-v5.99.1-d7efd75-windows-amd64.tar.xz
|
|
SFDX_AUTOUPDATE_DISABLE: true
|
|
SFDX_DOMAIN_RETRY: 300
|
|
|
|
install:
|
|
- ps: Install-Product node 8 x64
|
|
- appveyor-retry npm install
|
|
- curl -fsSL -o sfdx-windows-amd64.tar.xz %SFDX_URL_WINDOWS%
|
|
- 7z x sfdx-windows-amd64.tar.xz
|
|
- 7z x sfdx-windows-amd64.tar
|
|
- SET PATH=%APPVEYOR_BUILD_FOLDER%\sfdx\bin;%PATH%
|
|
- sfdx update
|
|
- npm install -g codecov
|
|
# the JWT key should be stored base 64 encoded in AppVeyor settings
|
|
- 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
|
|
$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"
|
|
Get-ChildItem -Path $ProjectRoot\packages\*\xunit.xml -File | Foreach-Object {
|
|
$Address = "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)"
|
|
$Source = $_.FullName
|
|
"$Address $Source"
|
|
(New-Object 'System.Net.WebClient').UploadFile( $Address, $Source )
|
|
}
|
|
# Fail script in case of test failures
|
|
if($NpmTestsExitCode -ne 0) {
|
|
$Error | Format-List * -Force
|
|
exit $NpmTestsExitCode
|
|
}
|
|
- npm run coverage:system-tests
|
|
- npm run vscode:package
|
|
|
|
on_finish:
|
|
- del C:\projects\devhub.key
|
|
- codecov --disable=gcov
|
|
|