product-build-linux.yml 4.7 KB
Newer Older
J
Joao Moreno 已提交
1 2 3
steps:
- task: NodeTool@0
  inputs:
A
Alex Dima 已提交
4
    versionSpec: "10.15.1"
J
Joao Moreno 已提交
5 6 7

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
8
    versionSpec: "1.10.1"
J
Joao Moreno 已提交
9

J
Joao Moreno 已提交
10 11 12
- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
J
build  
Joao Moreno 已提交
13
    azureSubscription: 'vscode-builds-subscription'
J
Joao Moreno 已提交
14 15
    KeyVaultName: vscode

J
Joao Moreno 已提交
16 17 18 19
- script: |
    set -e
    export npm_config_arch="$(VSCODE_ARCH)"

J
Joao Moreno 已提交
20 21
    cat << EOF > ~/.netrc
    machine monacotools.visualstudio.com
J
Joao Moreno 已提交
22
    password $(devops-pat)
J
Joao Moreno 已提交
23
    machine github.com
J
Joao Moreno 已提交
24
    login vscode
J
Joao Moreno 已提交
25
    password $(github-distro-mixin-password)
J
Joao Moreno 已提交
26 27
    EOF

J
Joao Moreno 已提交
28 29
    git config user.email "vscode@microsoft.com"
    git config user.name "VSCode"
J
Joao Moreno 已提交
30 31 32 33
  displayName: Prepare tooling

- script: |
    set -e
J
Joao Moreno 已提交
34 35 36
    git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
    git fetch distro
    git merge $(node -p "require('./package.json').distro")
J
Joao Moreno 已提交
37
  displayName: Merge distro
J
Joao Moreno 已提交
38

J
Joao Moreno 已提交
39 40
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
J
Joao Moreno 已提交
41
    keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
42 43 44
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'

J
Joao Moreno 已提交
45 46
- script: |
    set -e
J
Joao Moreno 已提交
47
    yarn --frozen-lockfile
J
Joao Moreno 已提交
48
  displayName: Install dependencies
J
Joao Moreno 已提交
49 50 51 52
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))

- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
  inputs:
J
Joao Moreno 已提交
53
    keyfile: '.yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
54 55
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
J
Joao Moreno 已提交
56

57 58 59 60 61 62 63 64 65
- script: |
    set -e
    yarn postinstall
    (cd build && yarn postinstall)
    (cd extensions && yarn postinstall)
    (cd test/smoke && yarn postinstall)
  displayName: Run postinstall scripts
  condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))

J
Joao Moreno 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
- script: |
    set -e
    yarn gulp mixin
  displayName: Mix in quality

- script: |
    set -e
    yarn gulp hygiene
    yarn monaco-compile-check
  displayName: Run hygiene checks
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
    set -e
    node build/azure-pipelines/common/installDistroDependencies.js
    node build/azure-pipelines/common/installDistroDependencies.js remote
    node build/lib/builtInExtensions.js
  displayName: Install distro dependencies and extensions

- script: |
    set -e
    cd $BUILD_STAGINGDIRECTORY
    git clone https://github.com/microsoft/vscode-telemetry-extractor.git
    cd vscode-telemetry-extractor
    git checkout 3b04aba5bfdfcca1a5426cd2c51a90d18740d0bc
    npm i
    npm run setup-extension-repos
    node ./out/cli-extract.js --sourceDir $BUILD_SOURCESDIRECTORY --excludedDirPattern extensions  --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents
    node ./out/cli-extract-extensions.js --sourceDir ./src/telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement
    mkdir -p $BUILD_SOURCESDIRECTORY/.build/telemetry
    mv declarations-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-core.json
    mv declarations-extensions-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-extensions.json
  displayName: Extract Telemetry

- script: |
    set -e
    yarn gulp compile-build
    yarn gulp compile-extensions-build
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
      yarn gulp vscode-linux-$VSCODE_ARCH-min-ci
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
      yarn gulp vscode-reh-linux-$VSCODE_ARCH-min-ci
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
      yarn gulp vscode-web-linux-$VSCODE_ARCH-min-ci
  displayName: Build

- script: |
    set -e
    yarn gulp "electron-$(VSCODE_ARCH)"

    # xvfb seems to be crashing often, let's make sure it's always up
    service xvfb start

    DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
    # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
  displayName: Run unit tests
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

J
Joao Moreno 已提交
124 125 126 127 128 129 130 131
# - script: |
#     set -e
#     AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
#     AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
#     VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
#     VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
#     ./build/azure-pipelines/linux/publish.sh
#   displayName: Publish
J
Joao Moreno 已提交
132 133 134 135 136 137 138 139 140 141

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
  displayName: 'Component Detection'
  continueOnError: true

- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
    artifactName: snap-$(VSCODE_ARCH)
    targetPath: .build/linux/snap-tarball