From 0500e43c37777200cab57d3b143a733fb9595271 Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 19 Jul 2024 14:13:07 +0200 Subject: [PATCH 1/6] ci: fixed some things --- .gitea/workflows/build_check.yaml | 17 ++++------------- sonar-project.properties | 1 + 2 files changed, 5 insertions(+), 13 deletions(-) create mode 100644 sonar-project.properties diff --git a/.gitea/workflows/build_check.yaml b/.gitea/workflows/build_check.yaml index 7120eae..6228e7c 100644 --- a/.gitea/workflows/build_check.yaml +++ b/.gitea/workflows/build_check.yaml @@ -16,16 +16,10 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Setup Go environment - uses: https://github.com/actions/setup-go@v5 + uses: https://gitea.com/actions/setup-go@v3 with: - # The Go version to download (if necessary) and use. Supports semver spec and ranges. - go-version: 1.22.0 # optional - # Path to the go.mod file. - go-version-file: ./go.mod # optional - # Set this option to true if you want the action to always check for the latest available version that satisfies the version spec - check-latest: true # optional - # Used to specify whether caching is needed. Set to true, if you'd like to enable caching. - cache: true # optional + go-version-file: 'go.mod' + cache: true - name: Execute Go Test files with coverage report run: TESTCONTAINERS_RYUK_DISABLED=true go test -v ./... -json -coverprofile="coverage.out" | tee "test-report.out" @@ -33,7 +27,4 @@ jobs: - uses: sonarsource/sonarqube-scan-action@master env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} - with: - args: > - -Dsonar.projectKey=Anthrove---OtterSpace-SDK \ No newline at end of file + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..f8d8cc9 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=Anthrove---OtterSpace-SDK -- 2.45.2 From 8fe87e12dff5eb7ccf61a7f187ff0da102485e5d Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 19 Jul 2024 14:13:31 +0200 Subject: [PATCH 2/6] ci: added ci branch for trigger --- .gitea/workflows/build_check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build_check.yaml b/.gitea/workflows/build_check.yaml index 6228e7c..810024c 100644 --- a/.gitea/workflows/build_check.yaml +++ b/.gitea/workflows/build_check.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - ci/* pull_request: branches: [ "main" ] -- 2.45.2 From 10aaf14a34385973dfc4ac10463d9edf492fb8db Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 19 Jul 2024 14:29:05 +0200 Subject: [PATCH 3/6] ci: disable cache --- .gitea/workflows/build_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build_check.yaml b/.gitea/workflows/build_check.yaml index 810024c..01da39a 100644 --- a/.gitea/workflows/build_check.yaml +++ b/.gitea/workflows/build_check.yaml @@ -20,7 +20,7 @@ jobs: uses: https://gitea.com/actions/setup-go@v3 with: go-version-file: 'go.mod' - cache: true + cache: false - name: Execute Go Test files with coverage report run: TESTCONTAINERS_RYUK_DISABLED=true go test -v ./... -json -coverprofile="coverage.out" | tee "test-report.out" -- 2.45.2 From 92cf00d83a9e70b4a8f4abff1e8f1724799c7ee5 Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 19 Jul 2024 14:40:20 +0200 Subject: [PATCH 4/6] ci: renamed build steps --- .gitea/workflows/build_check.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_check.yaml b/.gitea/workflows/build_check.yaml index 01da39a..9fb3f12 100644 --- a/.gitea/workflows/build_check.yaml +++ b/.gitea/workflows/build_check.yaml @@ -12,7 +12,8 @@ jobs: Build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout Git Repo + uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis @@ -25,7 +26,8 @@ jobs: - name: Execute Go Test files with coverage report run: TESTCONTAINERS_RYUK_DISABLED=true go test -v ./... -json -coverprofile="coverage.out" | tee "test-report.out" - - uses: sonarsource/sonarqube-scan-action@master + - name: SonarQube + uses: sonarsource/sonarqube-scan-action@master env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} \ No newline at end of file -- 2.45.2 From 91da9b7035e96397f56b7c52f7623de23640ef62 Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 19 Jul 2024 14:45:52 +0200 Subject: [PATCH 5/6] ci: removed branch main and added dev --- .gitea/workflows/build_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build_check.yaml b/.gitea/workflows/build_check.yaml index 9fb3f12..e5c5c81 100644 --- a/.gitea/workflows/build_check.yaml +++ b/.gitea/workflows/build_check.yaml @@ -3,8 +3,8 @@ run-name: ${{ gitea.actor }} is testing the build on: push: branches: - - main - ci/* + - dev/* pull_request: branches: [ "main" ] -- 2.45.2 From 652b2ea7166ae3617f8d6d46133a97687e73c832 Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 19 Jul 2024 14:54:30 +0200 Subject: [PATCH 6/6] docs: updated readme --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a0828e0..19c63fb 100644 --- a/README.md +++ b/README.md @@ -33,24 +33,22 @@ package main import ( "context" - "fmt" + "log" "git.dragse.it/anthrove/otter-space-sdk/v2/pkg/database" "git.dragse.it/anthrove/otter-space-sdk/v2/pkg/models" ) func main() { - var err error - dbDebug := false - ctx := context.Background() - - pgClient := database.NewPostgresqlConnection(dbDebug) - err = pgClient.Connect(ctx, "your-endpoint", "your-username", "your-password", "anthrove", 5432, "disable", "Europe/Berlin") + ctx := context.Background() + cfg := models.DatabaseConfig{} + + pgClient := database.NewPostgresqlConnection() + err := pgClient.Connect(ctx, cfg) if err != nil { - fmt.Println(err) - return + log.Panic(err) } - // further usage of the client... + } ``` -- 2.45.2