From 3a56b2b4c8030afeabfaebcaa79cd67ad1a7dc90 Mon Sep 17 00:00:00 2001 From: Yieldone Date: Thu, 27 Jun 2024 22:26:19 +0800 Subject: [PATCH] fix(ci/cd): codecov build err --- .github/workflows/ci-codecov.yml | 1 - codecov.yml | 23 +++++++++++++++++++++++ go.mod | 2 +- tools/exifviewer/main.go | 13 +++++-------- 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/ci-codecov.yml b/.github/workflows/ci-codecov.yml index 07e2459..0bbe184 100644 --- a/.github/workflows/ci-codecov.yml +++ b/.github/workflows/ci-codecov.yml @@ -13,7 +13,6 @@ jobs: matrix: go: - '1.21' - - '1.20' steps: - name: Checkout code diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..e640968 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,23 @@ +codecov: + require_ci_to_pass: yes +coverage: + status: + patch: no + project: + default: + threshold: 1% + if_not_found: success + changes: no + #What precision do you want the coverage value to be + precision: 2 + #The value range where you want the value to be green + range: "50...100" +ignore: + - "test/.*" + - ".github/.*" + - "input/.*" + - "*.md" +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: no \ No newline at end of file diff --git a/go.mod b/go.mod index 8e72806..ec78ef4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/sincerefly/capybara -go 1.20 +go 1.21 require ( github.com/alitto/pond v1.9.0 diff --git a/tools/exifviewer/main.go b/tools/exifviewer/main.go index 791e4b1..f75069e 100644 --- a/tools/exifviewer/main.go +++ b/tools/exifviewer/main.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/sincerefly/capybara/utils/exif_utils" + "github.com/sincerefly/capybara/service/border/styles_common" "github.com/sincerefly/capybara/utils/fileitem" "os" "path/filepath" @@ -24,19 +24,16 @@ func main() { imgPath := args[0] - // parser exif meta data - etClient, err := exif_utils.NewExifClient() - if err != nil { - fmt.Println(err) - } - filename := filepath.Base(imgPath) fi := fileitem.NewFileItem(filename) fi.SetInnerPath(filepath.Dir(imgPath)) store := fileitem.NewFileItemStore() store.Add(fi) - metas := etClient.GetFilesMetaByStore(&store) + metas, err := styles_common.GetFilesMetaByStore(&store) + if err != nil { + fmt.Println(err) + } for field, value := range metas[0].PrimitiveMeta().Fields { fmt.Printf("[%s] %v\n", field, value)