@@ -6,9 +6,10 @@ import (
66 "github.com/devstream-io/devstream/pkg/util/types"
77)
88
9- type Language struct {
10- Name string `mapstructure:"name"`
11- Version string `mapstructure:"version"`
9+ type language struct {
10+ Name string `mapstructure:"name"`
11+ Version string `mapstructure:"version"`
12+ FrameWork string `mapstructure:"frameWork"`
1213}
1314
1415type generalDefaultOption struct {
@@ -18,15 +19,15 @@ type generalDefaultOption struct {
1819var languageDefaultOptionMap = map [string ]* generalDefaultOption {
1920 "java" : {
2021 testOption : & test {
21- Command : "mvn -B test" ,
22+ Command : [] string { "mvn -B test" } ,
2223 ContainerName : "maven:3.8.1-jdk-8" ,
2324 Enable : types .Bool (true ),
2425 },
2526 },
26- "golang " : {
27+ "go " : {
2728 testOption : & test {
2829 Enable : types .Bool (true ),
29- Command : "go test ./..." ,
30+ Command : [] string { "go test ./..." } ,
3031 CoverageCommand : "go tool cover -func=coverage.out >> coverage.cov" ,
3132 CoverageStatusCommand : `cat coverage.cov
3233body=$(cat coverage.cov)
@@ -36,9 +37,29 @@ body="${body//$'\r'/'%0D'}"
3637echo ::set-output name=body::$body` ,
3738 },
3839 },
40+ "python" : {
41+ testOption : & test {
42+ Command : []string {
43+ "python -m pip install --upgrade pip" ,
44+ "pip install -r requirements.txt" ,
45+ "python3 -m unittest" ,
46+ },
47+ Enable : types .Bool (true ),
48+ },
49+ },
50+ "nodejs" : {
51+ testOption : & test {
52+ Command : []string {
53+ "npm ci" ,
54+ "npm run build --if-present" ,
55+ "npm test" ,
56+ },
57+ Enable : types .Bool (true ),
58+ },
59+ },
3960}
4061
41- func (l * Language ) getGeneralDefaultOption () * generalDefaultOption {
62+ func (l * language ) getGeneralDefaultOption () * generalDefaultOption {
4263 lang := strings .TrimSpace (strings .ToLower (l .Name ))
4364 return languageDefaultOptionMap [lang ]
4465}
0 commit comments