From cf8584e0c3107589eb6d5842cb0108eec542964d Mon Sep 17 00:00:00 2001 From: taobig Date: Sat, 8 Jun 2024 10:10:57 +0800 Subject: [PATCH] Update CI config --- .github/workflows/go.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1b039ce..3be054d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -40,10 +40,17 @@ jobs: # 在并发情况下,同时运行的测试的数量默认取决于 GOMAXPROCS。它可以通过 -parallel n 被指定(go test -parallel 4) # run: go test -cover -v ./... run: | - go test -cover -v ./... - go vet ./... -# golangci-lint run #golangci-lint run --enable-all 如果手动执行,需要提前下载golangci-lint -# CI是通过golangci-lint.yml配置文件启用的 +# 从go1.20开始test子命令才支持-skip参数 + if [[ "${{ matrix.go-version }}" < "1.20" ]]; then + go test -cover -v ./... + go test -race -v ./... + else + go test -skip "^TestSendMail$" -cover -v ./... + go test -race -skip "^TestSendMail$" -skip "^TestDataRaceError$" -v ./... + fi + go vet ./... +# golangci-lint run #golangci-lint run --enable-all 如果手动执行,需要提前下载golangci-lint +# CI是通过golangci-lint.yml配置文件启用的 - name: Test Parallel