Skip to content

Commit

Permalink
Update main.workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Feb 12, 2019
1 parent e034bc4 commit 6c3779e
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 91 deletions.
27 changes: 27 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
workflow "Build, Lint and Package" {
on = "push"
resolves = ["Package"]
}

action "Build" {
uses = "actions/npm@master"
args = "install"
}

action "Lint" {
needs = "Build"
uses = "actions/npm@master"
args = "run lint"
}

action "Test" {
needs = "Build"
uses = "actions/npm@master"
args = "run test"
}

action "Package" {
needs = "Test"
uses = "actions/npm@master"
args = "run package"
}
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/**/*.js"],
"preLaunchTask": "npm"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/out/test"],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "npm"
}
]
}
184 changes: 96 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,18 @@
}
},
"scripts": {
"vscode:prepublish": "tsc -p ./",
"vscode:prepublish": "npm run compile",
"package": "vsce package",
"compile": "tsc -p ./",
"watch": "tsc -w -p ./tsconfig.json",
"lint": "tslint --project tsconfig.json -t verbose",
"test": "npm run compile && node ./node_modules/vscode/bin/test",
"lint": "node ./node_modules/tslint/bin/tslint --project tsconfig.json -t verbose",
"lint-fix": "tslint --project tsconfig.json -t verbose --fix",
"postinstall": "node ./node_modules/vscode/bin/install"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.15",
"eslint": "^5.10.0",
"tape": "^4.9.1",
Expand Down
15 changes: 15 additions & 0 deletions test/extension.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as assert from 'assert';

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
// import * as vscode from 'vscode';
// import * as myExtension from '../extension';

// Defines a Mocha test suite to group tests of similar kind together
suite('Extension Tests', function() {
// Defines a Mocha unit test
test('Something 1', function() {
assert.equal(-1, [1, 2, 3].indexOf(5));
assert.equal(-1, [1, 2, 3].indexOf(0));
});
});
23 changes: 23 additions & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
//
// This file is providing the test runner to use when running extension tests.
// By default the test runner in use is Mocha based.
//
// You can provide your own test runner if you want to override it by exporting
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
// host can call to run the tests. The test runner is expected to use console.log
// to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none.

import * as testRunner from 'vscode/lib/testrunner';

// You can directly control Mocha options by configuring the test runner below
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options
// for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: true // colored output from test results
});

module.exports = testRunner;
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"sourceMap": true,
"rootDir": "."
},
"exclude": ["node_modules", ".vscode-test", "test"]
"exclude": ["node_modules", ".vscode-test"]
}

0 comments on commit 6c3779e

Please sign in to comment.