From c913e423ecf3cdfbde29ed4293855aadae98f033 Mon Sep 17 00:00:00 2001 From: Kevin Mesiab Date: Mon, 23 Dec 2024 01:57:30 -0800 Subject: [PATCH] Add badges --- .github/go-test.yml | 41 ---------------------------- .github/{ => workflows}/go-build.yml | 0 .github/{ => workflows}/go-lint.yml | 3 +- .github/workflows/go-test.yml | 30 ++++++++++++++++++++ README.md | 7 +++++ database/repository_test.go | 4 +-- 6 files changed, 40 insertions(+), 45 deletions(-) delete mode 100644 .github/go-test.yml rename .github/{ => workflows}/go-build.yml (100%) rename .github/{ => workflows}/go-lint.yml (96%) create mode 100644 .github/workflows/go-test.yml diff --git a/.github/go-test.yml b/.github/go-test.yml deleted file mode 100644 index 1ce7d64..0000000 --- a/.github/go-test.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Test - -defaults: - run: - shell: bash - -on: - push: - branches: - - '**' - -jobs: - build: - name: ๐Ÿงช Unit Tests - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.23 - - - name: Set up gotestfmt - run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest - - # Run tests with nice formatting. Save the original log in /tmp/gotest.log - - name: ๐Ÿงช Execute Tests - run: | - set -euo pipefail - go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt - - # Upload the original go test log as an artifact for later review. - - name: Upload test log - uses: actions/upload-artifact@v2 - if: always() - with: - name: test-log - path: /tmp/gotest.log - if-no-files-found: error diff --git a/.github/go-build.yml b/.github/workflows/go-build.yml similarity index 100% rename from .github/go-build.yml rename to .github/workflows/go-build.yml diff --git a/.github/go-lint.yml b/.github/workflows/go-lint.yml similarity index 96% rename from .github/go-lint.yml rename to .github/workflows/go-lint.yml index a945d35..e23d267 100644 --- a/.github/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -48,5 +48,4 @@ jobs: - name: ๐Ÿ•ต๏ธโ€โ™‚๏ธ Run GolangCI-Lint uses: golangci/golangci-lint-action@v3 - with: - version: v1.54 + diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 0000000..d0c06f9 --- /dev/null +++ b/.github/workflows/go-test.yml @@ -0,0 +1,30 @@ +name: Test + +defaults: + run: + shell: bash + +on: + push: + branches: + - '**' + +jobs: + + build_go: + name: "๐Ÿ— Compile" + + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›’ Checkout Code + uses: actions/checkout@v3 + + - name: ๐Ÿš€ Set up Go + uses: actions/setup-go@v4.1.0 + with: + go-version: '1.23' + cache: true + check-latest: true + + - name: ๐Ÿงช Test + run: go test -v ./... diff --git a/README.md b/README.md index 2a84c8e..67b240c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # ๐Ÿค‘ Chime AI ๐Ÿค– +![Golang](https://img.shields.io/badge/Go-00add8.svg?labelColor=171e21&style=for-the-badge&logo=go) + +![Build](https://github.com/kmesiab/chime-ai/actions/workflows/go-build.yml/badge.svg) +![Lint](https://github.com/kmesiab/chime-ai/actions/workflows/go-lint.yml/badge.svg) +![Test](https://github.com/kmesiab/chime-ai/actions/workflows/go-test.yml/badge.svg) +[![Go Report Card](https://goreportcard.com/badge/github.com/kmesiab/chime-ai)](https://goreportcard.com/report/github.com/kmesiab/equilibria) + **Import your Chime bank statements in PDF format, then chat about them with AI.** _Note: This is a hacky personal project. Don't rely on this for important things..._ diff --git a/database/repository_test.go b/database/repository_test.go index 2754e51..a81c69a 100644 --- a/database/repository_test.go +++ b/database/repository_test.go @@ -119,8 +119,8 @@ func TestExecuteRawQuery_NoResults(t *testing.T) { args := []interface{}{"Nonexistent Description"} result, err := repo.ExecuteRawQuery(query, args...) - if err != nil { - t.Errorf("unexpected error: %v", err) + if err == nil { + t.Errorf("expected error but got none") } // Assert that the result is an empty slice