Skip to content

Commit cd8cae6

Browse files
committed
Upload vsix to artifacts (#5412)
1 parent 7b652d8 commit cd8cae6

File tree

6 files changed

+204
-13
lines changed

6 files changed

+204
-13
lines changed

build/ci/templates/build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
steps:
2+
- bash: |
3+
printenv
4+
displayName: "Show all env vars"
5+
condition: eq(variables['system.debug'], 'true')
6+
7+
- task: NodeTool@0
8+
displayName: "Use Node $(NodeVersion)"
9+
inputs:
10+
versionSpec: $(NodeVersion)
11+
12+
- task: UsePythonVersion@0
13+
displayName: "Use Python $(PythonVersion)"
14+
inputs:
15+
versionSpec: $(PythonVersion)
16+
17+
- task: Npm@1
18+
displayName: "Use NPM $(NpmVersion)"
19+
inputs:
20+
command: custom
21+
verbose: true
22+
customCommand: "install -g npm@$(NpmVersion)"
23+
24+
- task: Npm@1
25+
displayName: "npm ci"
26+
inputs:
27+
command: custom
28+
verbose: true
29+
customCommand: ci
30+
31+
- bash: |
32+
echo AVAILABLE DEPENDENCY VERSIONS
33+
echo Node Version = `node -v`
34+
echo NPM Version = `npm -v`
35+
echo Python Version = `python --version`
36+
echo Gulp Version = `gulp --version`
37+
condition: and(succeeded(), eq(variables['system.debug'], 'true'))
38+
displayName: Show Dependency Versions
39+
40+
- task: Gulp@0
41+
displayName: "Compile and check for errors"
42+
inputs:
43+
targets: "prePublishNonBundle"
44+
condition: and(succeeded(), eq(variables['Build'], 'false'))
45+
46+
- bash: npx tslint ./src/**/*.ts{,x}
47+
displayName: "code hygiene"
48+
condition: and(succeeded(), eq(variables['Build'], 'false'))
49+
50+
- bash: |
51+
python -m pip install -U pip
52+
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt
53+
failOnStderr: true
54+
displayName: "pip install requirements"
55+
condition: and(succeeded(), eq(variables['Build'], 'true'))
56+
57+
- bash: |
58+
npm install -g vsce
59+
npm run clean
60+
npm run updateBuildNumber -- --buildNumber $BUILD_BUILDID
61+
npm run package
62+
displayName: "Build VSIX"
63+
condition: and(succeeded(), eq(variables['Build'], 'true'))
64+
65+
- task: CopyFiles@2
66+
inputs:
67+
contents: "*.vsix"
68+
targetFolder: $(Build.ArtifactStagingDirectory)
69+
displayName: "Copy VSIX"
70+
condition: and(succeeded(), eq(variables['Build'], 'true'))
71+
72+
- task: PublishBuildArtifacts@1
73+
inputs:
74+
pathtoPublish: $(Build.ArtifactStagingDirectory)
75+
artifactName: VSIX
76+
displayName: "Publish VSIX to Arifacts"
77+
condition: and(succeeded(), eq(variables['Build'], 'true'))
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
steps:
2+
- bash: |
3+
printenv
4+
displayName: "Show all env vars"
5+
condition: eq(variables['system.debug'], 'true')
6+
7+
- task: NodeTool@0
8+
displayName: "Use Node $(NodeVersion)"
9+
inputs:
10+
versionSpec: $(NodeVersion)
11+
12+
- task: UsePythonVersion@0
13+
displayName: "Setup Python $(PythonVersion) for extension"
14+
inputs:
15+
versionSpec: $(PythonVersion)
16+
17+
- task: Npm@1
18+
displayName: "Use NPM $(NpmVersion)"
19+
inputs:
20+
command: custom
21+
verbose: true
22+
customCommand: "install -g npm@$(NpmVersion)"
23+
24+
- task: Npm@1
25+
displayName: "npm ci"
26+
inputs:
27+
command: custom
28+
verbose: true
29+
customCommand: ci
30+
31+
- bash: |
32+
echo AVAILABLE DEPENDENCY VERSIONS
33+
echo Node Version = `node -v`
34+
echo NPM Version = `npm -v`
35+
echo Python Version = `python --version`
36+
echo Gulp Version = `gulp --version`
37+
condition: and(succeeded(), eq(variables['system.debug'], 'true'))
38+
displayName: Show Dependency Versions
39+
40+
- task: Gulp@0
41+
displayName: "Compile"
42+
inputs:
43+
targets: "prePublishNonBundle"
44+
condition: succeeded()
45+
46+
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#azure-pipelines
47+
- bash: |
48+
set -e
49+
/usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 &
50+
disown -ar
51+
displayName: "Start xvfb"
52+
condition: and(succeeded(), eq(variables['Agent.Os'], 'Linux'), not(variables['SkipXvfb']))
53+
54+
- task: DownloadBuildArtifacts@0
55+
inputs:
56+
buildType: "current"
57+
artifactName: "VSIX"
58+
downloadPath: "$(Build.SourcesDirectory)"
59+
displayName: "Restore VSIX"
60+
condition: succeeded()
61+
62+
- task: CopyFiles@2
63+
inputs:
64+
sourceFolder: "$(Build.SourcesDirectory)/VSIX"
65+
targetFolder: $(Build.SourcesDirectory)
66+
displayName: "Copy VSIX"
67+
condition: succeeded()
68+
69+
- bash: npm run testSmoke
70+
displayName: "Run Smoke Tests"
71+
condition: succeeded()
72+
env:
73+
DISPLAY: :10

build/ci/vscode-python-ci.yaml

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: '$(Year:yyyy).$(Month).0.$(BuildID)-ci'
2-
# PR Validation build.
3-
# Notes: Only trigger a PR build for master and release, and skip build/rebuild
2+
# CI build.
3+
# Notes: Only trigger a commit for master and release, and skip build/rebuild
44
# on changes in the news and .vscode folders.
55
trigger:
66
branches:
@@ -21,6 +21,55 @@ variables:
2121
VSC_PYTHON_FORCE_LOGGING: true # Enable this to turn on console output for the logger
2222

2323
jobs:
24+
- job: Compile
25+
variables:
26+
Build: false
27+
pool:
28+
vmImage: "macos-10.13"
29+
steps:
30+
- template: templates/build.yml
31+
32+
- job: Build
33+
variables:
34+
Build: true
35+
pool:
36+
vmImage: "macos-10.13"
37+
steps:
38+
- template: templates/build.yml
39+
40+
- job: Smoke
41+
dependsOn:
42+
- Compile
43+
- Build
44+
45+
strategy:
46+
matrix:
47+
'Linux-Py3.7':
48+
PythonVersion: '3.7'
49+
VMImageName: 'ubuntu-16.04'
50+
TestsToRun: 'testSmoke'
51+
NeedsPythonTestReqs: true
52+
'Mac-Py3.7':
53+
PythonVersion: '3.7'
54+
VMImageName: 'macos-10.13'
55+
TestsToRun: 'testSmoke'
56+
NeedsPythonTestReqs: true
57+
'Linux-Py2.7':
58+
PythonVersion: '2.7'
59+
VMImageName: 'ubuntu-16.04'
60+
TestsToRun: 'testSmoke'
61+
NeedsPythonTestReqs: true
62+
'Mac-Py2.7':
63+
PythonVersion: '2.7'
64+
VMImageName: 'macos-10.13'
65+
TestsToRun: 'testSmoke'
66+
NeedsPythonTestReqs: true
67+
68+
pool:
69+
vmImage: $(VMImageName)
70+
71+
steps:
72+
- template: templates/uitest_phases.yml
2473

2574
- job: 'CI'
2675

@@ -224,43 +273,36 @@ jobs:
224273
TestsToRun: 'testfunctional'
225274
NeedsPythonTestReqs: true
226275
NeedsPythonFunctionalReqs: true
227-
# This tells the functional tests to not mock out Jupyter...
228-
VSCODE_PYTHON_ROLLING: true
229276
'Linux-Py3.7 Functional':
230277
PythonVersion: '3.7'
231278
VMImageName: 'ubuntu-16.04'
232279
TestsToRun: 'testfunctional'
233280
NeedsPythonTestReqs: true
234281
NeedsPythonFunctionalReqs: true
235-
VSCODE_PYTHON_ROLLING: true
236282
'Mac-Py3.7 Functional':
237283
PythonVersion: '3.7'
238284
VMImageName: 'macos-10.13'
239285
TestsToRun: 'testfunctional'
240286
NeedsPythonTestReqs: true
241287
NeedsPythonFunctionalReqs: true
242-
VSCODE_PYTHON_ROLLING: true
243288
'Windows-Py3.6 Functional':
244289
PythonVersion: '3.6'
245290
VMImageName: 'vs2017-win2016'
246291
TestsToRun: 'testfunctional'
247292
NeedsPythonTestReqs: true
248293
NeedsPythonFunctionalReqs: true
249-
VSCODE_PYTHON_ROLLING: true
250294
'Linux-Py3.6 Functional':
251295
PythonVersion: '3.6'
252296
VMImageName: 'ubuntu-16.04'
253297
TestsToRun: 'testfunctional'
254298
NeedsPythonTestReqs: true
255299
NeedsPythonFunctionalReqs: true
256-
VSCODE_PYTHON_ROLLING: true
257300
'Mac-Py3.6 Functional':
258301
PythonVersion: '3.6'
259302
VMImageName: 'macos-10.13'
260303
TestsToRun: 'testfunctional'
261304
NeedsPythonTestReqs: true
262305
NeedsPythonFunctionalReqs: true
263-
VSCODE_PYTHON_ROLLING: true
264306

265307
pool:
266308
vmImage: $(VMImageName)

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ gulp.task('installPythonLibs', async () => {
279279
function uploadExtension(uploadBlobName) {
280280
const azure = require('gulp-azure-storage');
281281
const rename = require("gulp-rename");
282-
return gulp.src('python*.vsix')
282+
return gulp.src('*python*.vsix')
283283
.pipe(rename(uploadBlobName))
284284
.pipe(azure.upload({
285285
account: process.env.AZURE_STORAGE_ACCOUNT,
@@ -289,7 +289,7 @@ function uploadExtension(uploadBlobName) {
289289
}
290290

291291
gulp.task('uploadDeveloperExtension', () => uploadExtension('ms-python-insiders.vsix'));
292-
gulp.task('uploadReleaseExtension', () => uploadExtension(`ms-python-${process.env.TRAVIS_BRANCH}.vsix`));
292+
gulp.task('uploadReleaseExtension', () => uploadExtension(`ms-python-${process.env.TRAVIS_BRANCH || process.env.BUILD_SOURCEBRANCHNAME}.vsix`));
293293

294294
function spawnAsync(command, args) {
295295
return new Promise((resolve, reject) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@
21032103
}
21042104
},
21052105
"scripts": {
2106-
"package": "gulp clean && gulp prePublishBundle && vsce package",
2106+
"package": "gulp clean && gulp prePublishBundle && vsce package -o ms-python-insiders.vsix",
21072107
"compile": "tsc -watch -p ./",
21082108
"compile-webviews-watch": "npx webpack --config webpack.datascience-ui.config.js --watch",
21092109
"dump-datascience-webpack-stats": "webpack --config webpack.datascience-ui.config.js --profile --json > tmp/ds-stats.json",

src/test/datascience/dataviewer.functional.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { parse } from 'node-html-parser';
1111
import * as React from 'react';
1212
import * as uuid from 'uuid/v4';
1313
import { Disposable } from 'vscode';
14-
1514
import { createDeferred } from '../../client/common/utils/async';
1615
import { Identifiers } from '../../client/datascience/constants';
1716
import { DataViewerMessages } from '../../client/datascience/data-viewing/types';

0 commit comments

Comments
 (0)