提交 cee77374 编写于 作者: R Roman Kuba

Merge branch 'gitlab-ci' into 'master'

Introducing CI jobs for linting and integration testing

Closes #185

See merge request gitlab-org/gitlab-vscode-extension!56
......@@ -14,9 +14,22 @@
"import/no-unresolved": [
2,
{
"ignore": ["vscode"]
"ignore": ["vscode", "vue", "v-tooltip"]
}
],
"prettier/prettier": ["error"]
"prettier/prettier": ["error"],
"no-underscore-dangle": "warn",
"class-methods-use-this": "warn",
"camelcase": "warn",
"no-param-reassign": "warn",
"prefer-destructuring": "warn",
"no-useless-escape": "warn",
"prefer-template": "warn",
"no-plusplus": "warn",
"no-shadow": "warn",
"no-else-return": "warn",
"prefer-const": "warn",
"no-empty": "warn",
"no-unused-vars": "warn"
}
}
......@@ -2,3 +2,26 @@ include:
- template: SAST.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
- template: License-Scanning.gitlab-ci.yml
image: node:12-slim
stages:
- test
lint:
stage: test
script:
- yarn
- yarn run eslint
test-integration:
stage: test
variables:
DISPLAY: ':99.0'
script:
- apt-get update
- apt-get install -y xvfb libxtst6 libnss3 libgtk-3-0 libxss1 libasound2 libsecret-1-0
- yarn
- echo $DISPLAY
- /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- yarn test
......@@ -17,7 +17,7 @@
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/test"
"--extensionTestsPath=${workspaceRoot}/out/unit_tests/"
],
"stopOnEntry": false
}
......
......@@ -488,12 +488,12 @@
},
"scripts": {
"vscode:prepublish": "yarn run compile",
"compile": "node_modules/.bin/tsc -p ./",
"watch": "node_modules/.bin/tsc -watch -p ./",
"test": "node ./out/runTest.js",
"eslint": "node_modules/.bin/eslint --max-warnings 0 --ext .js .",
"format": "node_modules/.bin/prettier --write '**/*.{js,json}'",
"publish": "node_modules/.bin/vsce publish",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"test": "yarn compile && node ./out/runTest.js",
"eslint": "eslint --max-warnings 49 --ext .js .",
"format": "prettier --write '**/*.{js,json}'",
"publish": "vsce publish",
"webview": "cd src/webview ; yarn install ; yarn watch"
},
"devDependencies": {
......
......@@ -136,11 +136,19 @@ async function create(issuable, workspaceFolder) {
const html = replaceResources(panel);
panel.webview.html = html;
let lightIconUri = vscode.Uri.file(path.join(context.extensionPath, 'src', 'assets', 'images', 'light', 'issues.svg'));
let darkIconUri = vscode.Uri.file(path.join(context.extensionPath, 'src', 'assets', 'images', 'dark', 'issues.svg'));
let lightIconUri = vscode.Uri.file(
path.join(context.extensionPath, 'src', 'assets', 'images', 'light', 'issues.svg'),
);
let darkIconUri = vscode.Uri.file(
path.join(context.extensionPath, 'src', 'assets', 'images', 'dark', 'issues.svg'),
);
if (issuable.squash_commit_sha !== undefined) {
lightIconUri = vscode.Uri.file(path.join(context.extensionPath, 'src', 'assets', 'images', 'light', 'merge_requests.svg'));
darkIconUri = vscode.Uri.file(path.join(context.extensionPath, 'src', 'assets', 'images', 'dark', 'merge_requests.svg'));
lightIconUri = vscode.Uri.file(
path.join(context.extensionPath, 'src', 'assets', 'images', 'light', 'merge_requests.svg'),
);
darkIconUri = vscode.Uri.file(
path.join(context.extensionPath, 'src', 'assets', 'images', 'dark', 'merge_requests.svg'),
);
}
panel.iconPath = { light: lightIconUri, dark: darkIconUri };
......
......@@ -4,7 +4,7 @@ import { runTests } from 'vscode-test';
async function go() {
try {
const extensionDevelopmentPath = path.resolve(__dirname, '../src');
const extensionDevelopmentPath = path.resolve(__dirname, '../');
const extensionTestsPath = path.resolve(__dirname, './unit_tests');
await runTests({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册