diff --git a/.gitea/workflows/build_check.yaml b/.gitea/workflows/build_check.yaml index 7120eae..e5c5c81 100644 --- a/.gitea/workflows/build_check.yaml +++ b/.gitea/workflows/build_check.yaml @@ -3,7 +3,8 @@ run-name: ${{ gitea.actor }} is testing the build on: push: branches: - - main + - ci/* + - dev/* pull_request: branches: [ "main" ] @@ -11,29 +12,22 @@ 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 - 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: 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" - - 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 }} - 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/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... + } ``` 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