From cf60e5a60abe93ccc825c0261bf321fc61cf1891 Mon Sep 17 00:00:00 2001 From: levi Date: Tue, 1 Nov 2022 15:30:45 +0800 Subject: [PATCH] ci: fix web embed --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- cmd/{cli => gopeed}/flags.go | 0 cmd/{cli => gopeed}/main.go | 0 cmd/web/main.go | 3 +++ 5 files changed, 5 insertions(+), 2 deletions(-) rename cmd/{cli => gopeed}/flags.go (100%) rename cmd/{cli => gopeed}/main.go (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02ddfe9f..10314baf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -199,7 +199,7 @@ jobs: for goos in "${goos_arr[@]}"; do for goarch in "${goarch_arr[@]}"; do dir="dist/gopeed-$VERSION-$goos-$goarch/" - (GOOS=$goos GOARCH=$goarch go build -tags nosqlite -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/web \ + (GOOS=$goos GOARCH=$goarch go build -tags nosqlite,web -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/web \ && cd $dir \ && rename 's/^web/gopeed/' * \ && zip -r ../zip/gopeed-web-$VERSION-$goos-$goarch.zip * \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7566412c..d0097556 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: go-version: '^1.19' cache: true - name: Run Unit tests. - run: go test ./... -v -covermode=count -coverprofile=coverage.txt + run: go test $(go list ./... | grep -v /cmd/ | grep -v /bind/ ) -v -covermode=count -coverprofile=coverage.txt - uses: codecov/codecov-action@v3 with: files: ./coverage.txt diff --git a/cmd/cli/flags.go b/cmd/gopeed/flags.go similarity index 100% rename from cmd/cli/flags.go rename to cmd/gopeed/flags.go diff --git a/cmd/cli/main.go b/cmd/gopeed/main.go similarity index 100% rename from cmd/cli/main.go rename to cmd/gopeed/main.go diff --git a/cmd/web/main.go b/cmd/web/main.go index be7e0ee1..8b25b17b 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -1,3 +1,6 @@ +//go:build web +// +build web + package main import (