Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sonar cloud fix
Browse files Browse the repository at this point in the history
rachit77 committed Sep 7, 2024
1 parent 2a5f311 commit 7dde240
Showing 4 changed files with 60 additions and 43 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/security-build.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test Unit

on:
push:
branches:
- main
- develop
- 'release/**'
pull_request:
workflow_dispatch: {}

jobs:
test-unit:
strategy:
fail-fast: false
matrix:
go-version: [1.22.4]
goarch: ["amd64"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

- name: Test
run: make test-unit

- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: coverage.out

sonar-cloud:
needs: test-unit
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Download code coverage results
uses: actions/download-artifact@v3
with:
name: code-coverage-report

- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/test-unittest.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ build-docker-nc: ## Builds a docker image with the cdk binary - but without buil
stop: ## Stops all services
docker-compose down

.PHONY: test
.PHONY: test-unit
test:
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -short -race -p 1 -covermode=atomic -coverprofile=../coverage.out -coverpkg ./... -timeout 200s ./...

0 comments on commit 7dde240

Please sign in to comment.