Fixed CI #2

Merged
SoXX merged 7 commits from ci/gitea into main 2024-07-19 13:14:00 +00:00
3 changed files with 19 additions and 26 deletions

View File

@ -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
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}

View File

@ -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...
}
```

1
sonar-project.properties Normal file
View File

@ -0,0 +1 @@
sonar.projectKey=Anthrove---OtterSpace-SDK