From d0a4e3a1ed20aeaf402aa05baef21bc01f808400 Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Wed, 10 Dec 2025 18:10:00 +0300 Subject: [PATCH 1/7] ci: add GitHub Actions workflow for tests and Codecov integration --- .github/workflows/tag.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/tag.yaml diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml new file mode 100644 index 0000000..c406798 --- /dev/null +++ b/.github/workflows/tag.yaml @@ -0,0 +1,27 @@ +name: Run Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: '1.24' + + - name: Run test with coverage + run: go test ./... -coverprofile=coverage.out -covermode=atomic + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + flags: go-1.24 \ No newline at end of file From 1658b1d985244d39af5cf4e1f572b41c29356077 Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Wed, 10 Dec 2025 18:13:48 +0300 Subject: [PATCH 2/7] ci: add GitHub Actions workflow for tests and Codecov integration --- .github/workflows/tag.yaml | 3 ++- go.sum | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 go.sum diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index c406798..3f31a4c 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -1,4 +1,4 @@ -name: Run Tests +name: Go on: push: @@ -8,6 +8,7 @@ on: jobs: test: + name: Run Tests and Upload Coverage runs-on: ubuntu-latest steps: - name: Checkout diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c4c1710 --- /dev/null +++ b/go.sum @@ -0,0 +1,10 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 28921de90eb842013d399384c74e608a96fddf1e Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Wed, 10 Dec 2025 18:16:45 +0300 Subject: [PATCH 3/7] ci: add GitHub Actions workflow for tests and Codecov integration --- .github/workflows/tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 3f31a4c..079a979 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -8,7 +8,7 @@ on: jobs: test: - name: Run Tests and Upload Coverage + name: Run Tests runs-on: ubuntu-latest steps: - name: Checkout From ef383c02148378a91cb98acdb055b29715056bc2 Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Thu, 11 Dec 2025 00:12:08 +0300 Subject: [PATCH 4/7] ci: add GitHub Actions workflow for tests and Codecov integration --- .github/workflows/tag.yaml | 8 ++++---- sonar-project.properties | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 079a979..3662f0e 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -22,7 +22,7 @@ jobs: - name: Run test with coverage run: go test ./... -coverprofile=coverage.out -covermode=atomic - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - flags: go-1.24 \ No newline at end of file + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@v2 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..87aa9ae --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,10 @@ +sonar.projectKey=codnect_tag +sonar.organization=codnect +sonar.host.url=https://sonarcloud.io + +sonar.sources=. +sonar.tests=. +sonar.test.inclusions=**/*_test.go + +# Go coverage +sonar.go.coverage.reportPaths=coverage.out \ No newline at end of file From 39c3d90b91f5ebce196b1256cb34e0c5bad282ae Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Thu, 11 Dec 2025 00:30:42 +0300 Subject: [PATCH 5/7] ci: add GitHub Actions workflow for tests and Codecov integration --- .github/workflows/tag.yaml | 2 +- sonar-project.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 3662f0e..75d3531 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -23,6 +23,6 @@ jobs: run: go test ./... -coverprofile=coverage.out -covermode=atomic - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@v2 + uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties index 87aa9ae..f38a162 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,4 +7,4 @@ sonar.tests=. sonar.test.inclusions=**/*_test.go # Go coverage -sonar.go.coverage.reportPaths=coverage.out \ No newline at end of file +sonar.go.coverage.reportPaths=../../coverage.out \ No newline at end of file From e617769701b2c74e7eeefaa084c3773e629d103d Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Thu, 11 Dec 2025 00:34:55 +0300 Subject: [PATCH 6/7] ci: add GitHub Actions workflow for tests and Codecov integration --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index f38a162..87aa9ae 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,4 +7,4 @@ sonar.tests=. sonar.test.inclusions=**/*_test.go # Go coverage -sonar.go.coverage.reportPaths=../../coverage.out \ No newline at end of file +sonar.go.coverage.reportPaths=coverage.out \ No newline at end of file From 023352f4052cb6138a219b7d0587ce061e28727b Mon Sep 17 00:00:00 2001 From: Burak Koken Date: Thu, 11 Dec 2025 00:43:25 +0300 Subject: [PATCH 7/7] ci: add GitHub Actions workflow for tests and Codecov integration --- .github/workflows/tag.yaml | 11 ++++++++++- sonar-project.properties | 10 ---------- 2 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 sonar-project.properties diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 75d3531..68d29ae 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -25,4 +25,13 @@ jobs: - name: SonarCloud Scan uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.projectKey=codnect_tag + -Dsonar.organization=codnect + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.sources=. + -Dsonar.tests=. + -Dsonar.test.inclusions=**/*_test.go + -Dsonar.go.coverage.reportPaths=coverage.out \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 87aa9ae..0000000 --- a/sonar-project.properties +++ /dev/null @@ -1,10 +0,0 @@ -sonar.projectKey=codnect_tag -sonar.organization=codnect -sonar.host.url=https://sonarcloud.io - -sonar.sources=. -sonar.tests=. -sonar.test.inclusions=**/*_test.go - -# Go coverage -sonar.go.coverage.reportPaths=coverage.out \ No newline at end of file