Compare commits
7 Commits
49a703643d
...
f0acfa0bdb
Author | SHA1 | Date | |
---|---|---|---|
f0acfa0bdb | |||
652b2ea716 | |||
91da9b7035 | |||
92cf00d83a | |||
10aaf14a34 | |||
8fe87e12df | |||
0500e43c37 |
@ -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
|
14
README.md
14
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()
|
||||
cfg := models.DatabaseConfig{}
|
||||
|
||||
pgClient := database.NewPostgresqlConnection(dbDebug)
|
||||
err = pgClient.Connect(ctx, "your-endpoint", "your-username", "your-password", "anthrove", 5432, "disable", "Europe/Berlin")
|
||||
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
1
sonar-project.properties
Normal file
@ -0,0 +1 @@
|
||||
sonar.projectKey=Anthrove---OtterSpace-SDK
|
Loading…
Reference in New Issue
Block a user