Skip to content

Commit b9252e8

Browse files
Merge pull request #29 from aptlogica/update-sonar-properties
removing jenkins and update sonar
2 parents a4b2a0a + a2be75d commit b9252e8

4 files changed

Lines changed: 91 additions & 56 deletions

File tree

.github/workflows/sonar.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Sonar Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- master
9+
- 'release/**'
10+
pull_request:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
sonar:
17+
name: Sonar Scan
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: '1.26.2'
30+
31+
- name: Install dependencies
32+
run: go mod download
33+
34+
- name: Run tests with coverage
35+
run: |
36+
go test -v ./... \
37+
-coverprofile=coverage.out \
38+
-covermode=atomic \
39+
-coverpkg=./...
40+
41+
- name: Show coverage summary
42+
run: |
43+
go tool cover -func=coverage.out
44+
45+
- name: Sonar Scan
46+
uses: SonarSource/sonarqube-scan-action@v6
47+
env:
48+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
49+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
50+
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
51+
52+
# - name: Sonar Quality Gate
53+
# uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
54+
# timeout-minutes: 10
55+
# env:
56+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
57+
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

.github/workflows/trivy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Security - Trivy
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
security-events: write
11+
12+
jobs:
13+
trivy:
14+
name: Trivy Scan
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Run Trivy Scan
22+
uses: aquasecurity/trivy-action@v0.35.0
23+
with:
24+
scan-type: fs
25+
format: sarif
26+
output: trivy-results.sarif
27+
severity: CRITICAL,HIGH
28+
29+
- name: Upload results to GitHub Security
30+
uses: github/codeql-action/upload-sarif@v3
31+
with:
32+
sarif_file: trivy-results.sarif

Jenkinsfile

Lines changed: 0 additions & 55 deletions
This file was deleted.

sonar-project.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
sonar.projectKey=aptlogica_sereni-email-smtp_81bfe731-8d64-4b02-a58c-81c48abd4f9a
1+
sonar.projectKey=aptlogica_sereni-email-smtp
2+
sonar.organization=aptlogica
23

34
sonar.language=go
45
sonar.sources=cmd,pkg,internal

0 commit comments

Comments
 (0)