Browse Source

更新生成和测试步骤

在测试和构建步骤中添加了 `go generate` 命令,确保在测试和构建之前生成必要的代码。这有助于保持代码的一致性和完整性。
SongZihuan 1 week ago
parent
commit
7cde8fdbf7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      .github/workflows/go-tag-release.yml

+ 3 - 1
.github/workflows/go-tag-release.yml

@@ -31,7 +31,8 @@ jobs:
 
       - name: Test
         run: |
-          go test ./...
+          GOOS=linux GOARCH=amd64 go generate ./...
+          GOOS=linux GOARCH=amd64 go test ./...
 
   build:
     runs-on: ubuntu-latest
@@ -49,6 +50,7 @@ jobs:
 
       - name: Build
         run: |
+          GOOS=linux GOARCH=amd64 go generate ./...
           GOOS=linux GOARCH=amd64 go build -o "${{ github.workspace }}/output/linux_amd64_lionv1" -trimpath -ldflags='-s -w -extldflags "-static"' -gcflags='-O4 -inline=2' github.com/SongZihuan/BackendServerTemplate/src/cmd/lionv1
           GOOS=linux GOARCH=amd64 go build -o "${{ github.workspace }}/output/linux_amd64_tigerv1" -trimpath -ldflags='-s -w -extldflags "-static"' -gcflags='-O4 -inline=2' github.com/SongZihuan/BackendServerTemplate/src/cmd/tigerv1
           GOOS=linux GOARCH=amd64 go build -o "${{ github.workspace }}/output/linux_amd64_catv1" -trimpath -ldflags='-s -w -extldflags "-static"' -gcflags='-O4 -inline=2' github.com/SongZihuan/BackendServerTemplate/src/cmd/catv1