diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..8603b53 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,41 @@ +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + name: Build + Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Postgres Docker + run: docker run -p 5432:5432 -d -e POSTGRES_HOST_AUTH_METHOD=trust postgres + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + + sonarCloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}