product-build-linux.yml 4.6 KB
Newer Older
J
Joao Moreno 已提交
1
steps:
J
Joao Moreno 已提交
2 3 4
- script: |
    mkdir -p .build
    echo -n $BUILD_SOURCEVERSION > .build/commit
5
    echo -n $VSCODE_QUALITY > .build/quality
J
Joao Moreno 已提交
6 7 8 9
  displayName: Prepare cache flag

- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
10
    keyfile: 'build/.cachesalt, .build/commit, .build/quality'
11
    targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min'
J
Joao Moreno 已提交
12 13 14 15 16 17 18 19 20 21
    vstsFeed: 'npm-vscode'
    platformIndependent: true
    alias: 'Compilation'

- script: |
    set -e
    exit 1
  displayName: Check RestoreCache
  condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

J
Joao Moreno 已提交
22 23 24 25 26 27
- task: NodeTool@0
  inputs:
    versionSpec: "10.15.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
I
isidor 已提交
28
    versionSpec: "1.x"
J
Joao Moreno 已提交
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
    azureSubscription: 'vscode-builds-subscription'
    KeyVaultName: vscode

- script: |
    set -e
    cat << EOF > ~/.netrc
    machine github.com
    login vscode
    password $(github-distro-mixin-password)
    EOF

    git config user.email "vscode@microsoft.com"
    git config user.name "VSCode"
  displayName: Prepare tooling

J
Joao Moreno 已提交
48 49
- script: |
    set -e
J
Joao Moreno 已提交
50 51 52 53 54
    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

J
Joao Moreno 已提交
55 56
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
57
    keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
58 59
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
J
Joao Moreno 已提交
60 61 62

- script: |
    set -e
J
Joao Moreno 已提交
63
    CHILD_CONCURRENCY=1 yarn --frozen-lockfile
J
Joao Moreno 已提交
64
  displayName: Install dependencies
J
Joao Moreno 已提交
65
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
66

J
Joao Moreno 已提交
67 68
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
  inputs:
69
    keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
70 71 72
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
73 74 75

- script: |
    set -e
J
Joao Moreno 已提交
76 77 78
    yarn postinstall
  displayName: Run postinstall scripts
  condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
79

J
Joao Moreno 已提交
80 81
- script: |
    set -e
J
Joao Moreno 已提交
82
    node build/azure-pipelines/mixin
J
Joao Moreno 已提交
83
  displayName: Mix in quality
J
Joao Moreno 已提交
84 85 86 87

- script: |
    set -e
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
J
Joao Moreno 已提交
88
      yarn gulp vscode-linux-x64-min-ci
J
Joao Moreno 已提交
89
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
J
Joao Moreno 已提交
90
      yarn gulp vscode-reh-linux-x64-min-ci
J
Joao Moreno 已提交
91
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
92
      yarn gulp vscode-reh-web-linux-x64-min-ci
J
Joao Moreno 已提交
93 94 95 96 97
  displayName: Build

- script: |
    set -e
    service xvfb start
J
Johannes Rieken 已提交
98 99
  displayName: Start xvfb
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
J
Joao Moreno 已提交
100

J
Johannes Rieken 已提交
101 102
- script: |
    set -e
R
Robo 已提交
103
    DISPLAY=:10 ./scripts/test.sh --build --tfs --no-sandbox "Unit Tests"
J
Joao Moreno 已提交
104 105 106
  displayName: Run unit tests
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

J
Johannes Rieken 已提交
107
- script: |
B
Benjamin Pasero 已提交
108 109 110
    # 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.
J
Johannes Rieken 已提交
111
    set -e
112 113 114
    APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
    APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
    INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
115
    VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
J
Johannes Rieken 已提交
116 117 118 119 120
    DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests"
    # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-x64"
  displayName: Run integration tests
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

J
Joao Moreno 已提交
121 122 123 124 125 126 127 128 129 130 131 132
- 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

- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
J
Joao Moreno 已提交
133
    artifactName: snap-x64
J
Joao Moreno 已提交
134
    targetPath: .build/linux/snap-tarball
J
Joao Moreno 已提交
135 136 137 138

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