Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: check git version #11687

Merged
merged 43 commits into from Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5a0879b
added script to check git version
RahulGautamSingh Sep 8, 2021
5c2e258
test script
RahulGautamSingh Sep 8, 2021
4f12118
changed formatting
RahulGautamSingh Sep 9, 2021
75cf396
chaanged script for git check
RahulGautamSingh Sep 9, 2021
37feea2
emitted script ignore
RahulGautamSingh Sep 10, 2021
c5b254e
changed filename to follow kebabcase
RahulGautamSingh Sep 10, 2021
bb085f7
Update tools/check-git-version.js
Sep 11, 2021
d3836ed
Added regex to comapre git version
Sep 12, 2021
c145230
changed code logic
Sep 12, 2021
8ca4e17
removed .vscode directory
Sep 12, 2021
8e0666f
removed workflow trigger
Sep 12, 2021
2dc2854
changed code logic
Sep 12, 2021
3e1554d
changed code logic
Sep 12, 2021
3c61bba
changed code logic
RahulGautamSingh Sep 13, 2021
db21560
added minimum git version variable
RahulGautamSingh Sep 13, 2021
a858472
Update tools/check-git-version.js
Sep 13, 2021
636c68d
Update .github/workflows/build.yml
Sep 13, 2021
4076d8c
Update tools/check-git-version.js
Sep 13, 2021
e865a3b
Update tools/check-git-version.js
Sep 13, 2021
43fb3c9
reverted unwanted changes
RahulGautamSingh Sep 13, 2021
b20051c
using js template in error message string
Sep 13, 2021
a41f104
added deleted files and using simple-git
RahulGautamSingh Sep 13, 2021
d5f54df
Update tools/check-git-version.js
rarkins Sep 14, 2021
165f616
Update tools/check-git-version.js
Sep 14, 2021
ae0d9fd
Update tools/check-git-version.js
Sep 14, 2021
c6d9299
changed file from js->mjs
RahulGautamSingh Sep 14, 2021
13bd65b
removed type:module
RahulGautamSingh Sep 14, 2021
9745244
removed unwanted changes
RahulGautamSingh Sep 14, 2021
05e2c82
Update package.json
Sep 15, 2021
23eda6a
Merge branch 'main' into feat/check-git-version
rarkins Sep 15, 2021
fc7a92a
Try mac/windows testing
rarkins Sep 15, 2021
8f1745b
Update build.yml
rarkins Sep 15, 2021
69531fe
Update build.yml
rarkins Sep 15, 2021
e9f559f
Update build.yml
rarkins Sep 15, 2021
b64570c
Update check-git-version.mjs
rarkins Sep 15, 2021
2a68923
Update build.yml
rarkins Sep 15, 2021
1d22ea7
Update build-pr.yml
rarkins Sep 15, 2021
1fb0306
Update build-pr.yml
rarkins Sep 15, 2021
ed2601f
Update tools/check-git-version.mjs
Sep 15, 2021
77ebe9b
Update tools/check-git-version.mjs
Sep 15, 2021
f3a7cd1
Merge branch 'main' into feat/check-git-version
viceice Sep 15, 2021
0e71e51
prettier formatting
RahulGautamSingh Sep 15, 2021
0fce1ac
removed unwanted vscode config
RahulGautamSingh Sep 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- v25
- feat/check-git-version
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved

workflow_dispatch:
inputs:
Expand Down
28 changes: 27 additions & 1 deletion .vscode/settings.json
Expand Up @@ -14,5 +14,31 @@
},
"omnisharp.autoStart": false,
"jest.autoRun": "off",
"jest.jestCommandLine": "yarn jest"
"jest.jestCommandLine": "yarn jest",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#ffffff",
"activityBar.activeBorder": "#df9f9f",
"activityBar.background": "#ffffff",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#df9f9f",
"activityBarBadge.foreground": "#15202b",
"editorGroup.border": "#ffffff",
"panel.border": "#ffffff",
"sideBar.border": "#ffffff",
"statusBar.background": "#ffffff",
"statusBar.border": "#ffffff",
"statusBar.debuggingBackground": "#ffffff",
"statusBar.debuggingBorder": "#ffffff",
"statusBar.debuggingForeground": "#15202b",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#e6e6e6",
"tab.activeBorder": "#ffffff",
"titleBar.activeBackground": "#eeeeee",
"titleBar.activeForeground": "#15202b",
"titleBar.border": "#eeeeee",
"titleBar.inactiveBackground": "#eeeeee99",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#3a96ba"
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -19,10 +19,11 @@
"eslint-fix": "eslint --ext .js,.mjs,.ts --fix lib/ test/ tools/",
"generate": "run-s generate:*",
"generate:imports": "node tools/generate-imports.mjs",
"git-check":"node tools/check-git-version.js",
"jest": "cross-env NODE_ENV=test LOG_LEVEL=fatal node --expose-gc node_modules/jest/bin/jest.js --logHeapUsage",
"jest-debug": "cross-env NODE_OPTIONS=--inspect-brk yarn jest",
"jest-silent": "cross-env yarn jest --reporters jest-silent-reporter",
"lint": "run-s ls-lint eslint prettier markdown-lint",
"lint": "run-s ls-lint eslint prettier markdown-lint git-check",
"lint-fix": "run-s eslint-fix prettier-fix markdown-lint-fix",
"ls-lint": "ls-lint",
"markdown-lint": "markdownlint-cli2",
Expand Down
24 changes: 24 additions & 0 deletions tools/check-git-version.js
@@ -0,0 +1,24 @@
const shell = require('shelljs');

function checkGitVersion() {
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
try {
const gitVersion = shell
.exec('git --version', { silent: true })
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
.stdout.toString()
.slice(12)
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
.split('.');
if (
parseInt(gitVersion[0], 10) >= 2 &&
parseInt(gitVersion[1], 10) >= 22 &&
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
parseInt(gitVersion[2], 10) >= 0
) {
process.exit(0);
} else {
throw new Error('Minimum git version 2.33.0 is required');
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
}
} catch (err) {
shell.echo('ERROR:', err.message);
process.exit(1);
}
}
checkGitVersion();
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved
RahulGautamSingh marked this conversation as resolved.
Show resolved Hide resolved