mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-28 04:02:12 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
64d3602d31 | ||
![]() |
aa2c4bbb6e | ||
![]() |
d20d6c9b7c | ||
![]() |
a99254d0c3 | ||
![]() |
099dfeddcb | ||
![]() |
a5ea8debaa | ||
![]() |
6f1de5cae8 |
54
.github/workflows/ci.yaml
vendored
54
.github/workflows/ci.yaml
vendored
@@ -47,41 +47,19 @@ jobs:
|
||||
GOPRIVATE: github.com/oneclickvirt/security
|
||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||
|
||||
test:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Configure Git for Private Modules
|
||||
run: |
|
||||
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
||||
git config --global url."git@github.com:".insteadOf "https://github.com/"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||
- name: test
|
||||
run: go test -v ./...
|
||||
env:
|
||||
GOPRIVATE: github.com/oneclickvirt/security
|
||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||
|
||||
lint:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.22.4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Configure Git for Private Modules
|
||||
run: |
|
||||
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
||||
git config --global url."git@github.com:".insteadOf "https://github.com/"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.53.2
|
||||
env:
|
||||
GOPRIVATE: github.com/oneclickvirt/security
|
||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||
# test:
|
||||
# needs: setup
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - name: Configure Git for Private Modules
|
||||
# run: |
|
||||
# git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
|
||||
# git config --global url."git@github.com:".insteadOf "https://github.com/"
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GHT }}
|
||||
# - name: test
|
||||
# run: go test ./goecs_test.go
|
||||
# env:
|
||||
# GOPRIVATE: github.com/oneclickvirt/security
|
||||
# GITHUB_TOKEN: ${{ secrets.GHT }}
|
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/oneclickvirt/cputest/cpu"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func CpuTest(language, testMethod, testThread string) {
|
||||
@@ -31,5 +32,8 @@ func CpuTest(language, testMethod, testThread string) {
|
||||
res = "Invalid test method specified.\n"
|
||||
}
|
||||
}
|
||||
if !strings.Contains(res, "\n") && res != "" {
|
||||
res += "\n"
|
||||
}
|
||||
fmt.Print(res)
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/oneclickvirt/disktest/disk"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func DiskTest(language, testMethod, testPath string, isMultiCheck bool) {
|
||||
@@ -32,6 +33,9 @@ func DiskTest(language, testMethod, testPath string, isMultiCheck bool) {
|
||||
}
|
||||
}
|
||||
//fmt.Println("--------------------------------------------------")
|
||||
if !strings.Contains(res, "\n") && res != "" {
|
||||
res += "\n"
|
||||
}
|
||||
fmt.Printf(res)
|
||||
//fmt.Println("--------------------------------------------------")
|
||||
}
|
||||
|
6
goecs.go
6
goecs.go
@@ -30,7 +30,7 @@ func printCenteredTitle(title string, width int) {
|
||||
|
||||
func main() {
|
||||
var (
|
||||
ecsVersion = "2024.06.25"
|
||||
ecsVersion = "2024.06.29"
|
||||
showVersion bool
|
||||
language string
|
||||
cpuTestMethod, cpuTestThread string
|
||||
@@ -45,8 +45,8 @@ func main() {
|
||||
flag.StringVar(&language, "l", "zh", "Specify language (supported: en, zh)")
|
||||
flag.StringVar(&cpuTestMethod, "cpum", "sysbench", "Specify CPU test method (supported: sysbench, geekbench, winsat)")
|
||||
flag.StringVar(&cpuTestThread, "cput", "", "Specify CPU test thread count (supported: 1, 2, ...)")
|
||||
flag.StringVar(&memoryTestMethod, "memorym", "", "Specify Memory test method (supported: sysbench, dd, winsat)")
|
||||
flag.StringVar(&diskTestMethod, "diskm", "", "Specify Disk test method (supported: sysbench, dd, winsat)")
|
||||
flag.StringVar(&memoryTestMethod, "memorym", "dd", "Specify Memory test method (supported: sysbench, dd, winsat)")
|
||||
flag.StringVar(&diskTestMethod, "diskm", "fio", "Specify Disk test method (supported: fio, dd, winsat)")
|
||||
flag.StringVar(&diskTestPath, "diskp", "", "Specify Disk test path, example: -diskp /root")
|
||||
flag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable multiple disk checks, example: -diskmc=false")
|
||||
flag.Parse()
|
||||
|
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/oneclickvirt/memorytest/memory"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func MemoryTest(language, testMethod string) {
|
||||
@@ -27,5 +28,8 @@ func MemoryTest(language, testMethod string) {
|
||||
res = "Unsupported test method"
|
||||
}
|
||||
}
|
||||
if !strings.Contains(res, "\n") && res != "" {
|
||||
res += "\n"
|
||||
}
|
||||
fmt.Printf(res)
|
||||
}
|
||||
|
Reference in New Issue
Block a user