Skip to content

Commit

Permalink
sonar cloud fix (#66)
Browse files Browse the repository at this point in the history
* sonar cloud fix

* wip

* addressed feedback

* upgrade actions
  • Loading branch information
rachit77 authored Sep 10, 2024
1 parent 8793d69 commit 1ac7b63
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/security-build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-resequence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs_${{ github.run_id }}
path: ./kurtosis-cdk/ci_logs
40 changes: 40 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Unit and SonarCloud analysis

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@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

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

- name: Test
run: make test-unit

- 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.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ build-docker-nc: ## Builds a docker image with the cdk binary - but without buil
stop: ## Stops all services
docker-compose down

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

.PHONY: test-seq_sender
test-seq_sender:
Expand Down

0 comments on commit 1ac7b63

Please sign in to comment.