mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
* switiching product compile node cache task to newer version * moving new changes from product-compile to sql-product-compile * changing to yarn.lock as cache key * Adding compilation cache * changing keypath to key * letting find command do the heavy lifting * removing old save cache task * reverting compilation cache to old task * Creating a js to list compiled files switching to cache 2 for compiled files Creating a js file to compute yarn cache * removed unused input targetFolder from pipeline cache task * removed save cache * Fixing compute node modules file * Adding compiled computenodemodules * Fixing checked variables on product compile Updating all pipeline jobs to cache 2 Using tar for windows pipeline. Hoping it works * Fixing indentation in web job * Fixing different indentation in web job * Generating sha keys for compilation cache to be cross plat * trying deterministic key for compilation cache * Fixing md5 command * Trying another method of generating compilation cache * testing with a hardcoded string * Changing to a better hardcoded string * Remove redundant make dir * Fixing mkdir command in windows and trying new string key * fixing $$ in sql product compile * Removin redundant mkdir * Trying source version var * Fixing compilation key * chaning script to powershell * Adding artifacts to store compiled files switching to 7zip for windows node cache * Adding missing step key in web build * Building not found directories * Making correct directory * Switching to vscode's computeNodeModuleCache * Fixing formatting and making it look more like vscode's pipeline * Adding back compiled comput cache key * Fixing cache file * Fixing copyright message Adding sql header to custom node cache generator Updating cache salt to force a cache miss * Using glob instead of custom method to find all yarn.lock files Fixing some other pipeline errors. * Removing unnecessary variable checks. * Added back VSCODE_STEP_ON_IT check Moving drop artifacts before compiled files to keep it drop folder free from compiled files * Changing task name from cache flags to cache key * Removing glob from compute node module cache Fixing copyright message * checking in updated js
221 lines
8.0 KiB
YAML
221 lines
8.0 KiB
YAML
steps:
|
|
- task: InstallAppleCertificate@2
|
|
displayName: 'Install developer certificate'
|
|
inputs:
|
|
certSecureFile: 'osx_signing_key.p12'
|
|
condition: eq(variables['signed'], true)
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
inputs:
|
|
artifact: Compilation
|
|
path: $(Build.ArtifactStagingDirectory)
|
|
displayName: Download compilation output
|
|
|
|
- script: |
|
|
set -e
|
|
tar -xzf $(Build.ArtifactStagingDirectory)/compilation.tar.gz
|
|
displayName: Extract compilation output
|
|
|
|
- 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
|
|
|
|
- script: |
|
|
mkdir -p .build
|
|
node build/azure-pipelines/common/sql-computeNodeModulesCacheKey.js > .build/yarnlockhash
|
|
displayName: Prepare yarn cache key
|
|
|
|
- task: Cache@2
|
|
displayName: Restore Cache - Node Modules
|
|
inputs:
|
|
key: 'nodeModules | $(Agent.OS) | .build/yarnlockhash'
|
|
path: .build/node_modules_cache
|
|
cacheHitVar: NODE_MODULES_RESTORED
|
|
|
|
- script: |
|
|
set -e
|
|
tar -xzf .build/node_modules_cache/cache.tgz
|
|
condition: and(succeeded(), eq(variables.NODE_MODULES_RESTORED, 'true'))
|
|
displayName: Extract node_modules archive
|
|
|
|
- script: |
|
|
set -e
|
|
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
|
|
displayName: Install dependencies
|
|
env:
|
|
GITHUB_TOKEN: $(github-distro-mixin-password)
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
|
|
|
|
- script: |
|
|
set -e
|
|
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
|
|
mkdir -p .build/node_modules_cache
|
|
tar -czf .build/node_modules_cache/cache.tgz --files-from .build/node_modules_list.txt
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
|
|
displayName: Create node_modules archive
|
|
|
|
- script: |
|
|
set -e
|
|
yarn postinstall
|
|
displayName: Run postinstall scripts
|
|
condition: and(succeeded(), eq(variables.NODE_MODULES_RESTORED, '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-x64-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-x64
|
|
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-x64
|
|
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-x64
|
|
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-x64
|
|
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-x64
|
|
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
|