mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
220 lines
8.3 KiB
YAML
220 lines
8.3 KiB
YAML
steps:
|
|
- task: InstallAppleCertificate@2
|
|
displayName: 'Install developer certificate'
|
|
inputs:
|
|
certSecureFile: 'osx_signing_key.p12'
|
|
condition: eq(variables['signed'], true)
|
|
|
|
- script: |
|
|
mkdir -p .build
|
|
echo -n $BUILD_SOURCEVERSION > .build/commit
|
|
echo -n $VSCODE_QUALITY > .build/quality
|
|
displayName: Prepare cache flag
|
|
|
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
|
displayName: Restore Cache - Compiled Files
|
|
inputs:
|
|
keyfile: 'build/.cachesalt, .build/commit, .build/quality'
|
|
targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
|
|
vstsFeed: 'BuildCache'
|
|
platformIndependent: true
|
|
alias: 'Compilation'
|
|
|
|
- script: |
|
|
set -e
|
|
exit 1
|
|
displayName: Check RestoreCache
|
|
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))
|
|
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: "12.13.0"
|
|
|
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
|
|
inputs:
|
|
versionSpec: "1.x"
|
|
|
|
- task: AzureKeyVault@1
|
|
displayName: 'Azure Key Vault: Get Secrets'
|
|
inputs:
|
|
azureSubscription: 'ClientToolsInfra_670062 (88d5392f-a34f-4769-b405-f597fc533613)'
|
|
KeyVaultName: ado-secrets
|
|
SecretsFilter: 'github-distro-mixin-password'
|
|
|
|
- script: |
|
|
set -e
|
|
|
|
cat << EOF > ~/.netrc
|
|
machine github.com
|
|
login azuredatastudio
|
|
password $(github-distro-mixin-password)
|
|
EOF
|
|
|
|
git config user.email "sqltools@service.microsoft.com"
|
|
git config user.name "AzureDataStudio"
|
|
displayName: Prepare tooling
|
|
|
|
- script: |
|
|
set -e
|
|
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
|
git fetch distro
|
|
git merge $(node -p "require('./package.json').distro")
|
|
displayName: Merge distro
|
|
|
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
|
displayName: Restore Cache - Node Modules
|
|
inputs:
|
|
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
|
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
|
|
vstsFeed: 'BuildCache'
|
|
|
|
- script: |
|
|
set -e
|
|
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
|
|
displayName: Install dependencies
|
|
env:
|
|
GITHUB_TOKEN: $(github-distro-mixin-password)
|
|
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
|
|
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
|
displayName: Save Cache - Node Modules
|
|
inputs:
|
|
keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock, !samples/**/yarn.lock'
|
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules, !samples/**/node_modules'
|
|
vstsFeed: 'BuildCache'
|
|
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
|
|
|
- script: |
|
|
set -e
|
|
yarn postinstall
|
|
displayName: Run postinstall scripts
|
|
condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
|
|
|
|
- script: |
|
|
set -e
|
|
node build/azure-pipelines/mixin
|
|
displayName: Mix in quality
|
|
|
|
- script: |
|
|
set -e
|
|
yarn gulp package-rebuild-extensions
|
|
yarn gulp vscode-darwin-min-ci
|
|
displayName: Build
|
|
env:
|
|
VSCODE_MIXIN_PASSWORD: $(github-distro-mixin-password)
|
|
|
|
- script: |
|
|
set -e
|
|
./scripts/test.sh --build --coverage --reporter mocha-junit-reporter --tfs "Unit Tests"
|
|
displayName: Run unit tests
|
|
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
|
|
|
- script: |
|
|
# Figure out the full absolute path of the product we just built
|
|
# including the remote server and configure the integration tests
|
|
# to run with these builds instead of running out of sources.
|
|
set -e
|
|
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin
|
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
|
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
|
|
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/azuredatastudio-reh-darwin" \
|
|
./scripts/test-integration.sh --build --tfs "Integration Tests"
|
|
displayName: Run integration tests (Electron)
|
|
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
|
|
|
- script: |
|
|
set -e
|
|
APP_ROOT=$(agent.builddirectory)/azuredatastudio-darwin
|
|
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
|
yarn smoketest --build "$APP_ROOT/$APP_NAME" --screenshots "$(build.artifactstagingdirectory)/smokeshots" --log "$(build.artifactstagingdirectory)/logs/darwin/smoke.log"
|
|
displayName: Run smoke tests (Electron)
|
|
continueOnError: true
|
|
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
|
|
|
# - script: |
|
|
# set -e
|
|
# node ./node_modules/playwright/install.js
|
|
# VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/azuredatastudio-reh-web-darwin" \
|
|
# yarn smoketest --web --headless --screenshots "$(build.artifactstagingdirectory)/smokeshots"
|
|
# displayName: Run smoke tests (Browser)
|
|
# continueOnError: true
|
|
# condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
|
|
|
- script: |
|
|
set -e
|
|
pushd ../azuredatastudio-darwin
|
|
ls
|
|
|
|
echo "Cleaning the application"
|
|
xattr -cr *.app
|
|
cd *.app
|
|
find . -name '._*' -print0 | xargs -0 rm -rf --
|
|
cd ..
|
|
|
|
echo "Signing the application with deep"
|
|
codesign --deep --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS *.app
|
|
|
|
cd *.app
|
|
ls
|
|
echo "Signing specific components"
|
|
find . -type f -print0 | xargs -0 file | grep ': *Mach-O' | sed 's/: *Mach-O.*//' | while read -r file; do codesign --options runtime --timestamp --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS --force "$file" || break; done
|
|
|
|
echo "Signing Electron again..."
|
|
codesign --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS Contents/Frameworks/Electron\ Framework.framework
|
|
cd ..
|
|
|
|
echo "Signing the entire application one more time"
|
|
codesign --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS *.app
|
|
popd
|
|
displayName: 'Manual codesign'
|
|
condition: and(succeeded(), eq(variables['signed'], true))
|
|
|
|
- script: |
|
|
set -e
|
|
mkdir -p .build/darwin/archive
|
|
pushd ../azuredatastudio-darwin
|
|
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
|
|
popd
|
|
displayName: 'Archive (no signing)'
|
|
condition: and(succeeded(), eq(variables['signed'], false))
|
|
|
|
- script: |
|
|
set -e
|
|
mkdir -p .build/darwin/archive
|
|
pushd ../azuredatastudio-darwin
|
|
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin-unsigned.zip
|
|
popd
|
|
displayName: 'Archive'
|
|
condition: and(succeeded(), eq(variables['signed'], true))
|
|
|
|
- script: |
|
|
set -e
|
|
./build/azure-pipelines/darwin/createDrop.sh
|
|
displayName: Create Drop
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifact: drop'
|
|
condition: always()
|
|
|
|
- task: PublishTestResults@2
|
|
displayName: 'Publish Test Results test-results.xml'
|
|
inputs:
|
|
testResultsFiles: 'test-results.xml'
|
|
searchFolder: '$(Build.SourcesDirectory)'
|
|
continueOnError: true
|
|
condition: and(succeededOrFailed(), eq(variables['RUN_TESTS'], 'true'))
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
displayName: 'Publish code coverage from $(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
|
|
inputs:
|
|
codeCoverageTool: Cobertura
|
|
summaryFileLocation: '$(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
|
|
reportDirectory: '$(Build.SourcesDirectory)/.build/coverage'
|
|
continueOnError: true
|
|
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
|
|
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
displayName: 'Component Detection'
|
|
inputs:
|
|
failOnAlert: true
|