Skip to content

Commit

Permalink
fix(ci): Change the directory of test files, so SonarQube can find them
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Dec 20, 2024
1 parent b5a8035 commit 3edd025
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,20 @@ jobs:
echo "DB_CONN=\"file:db_test.sqlite3\"" >> .env.test
echo "DB_TYPE=\"sqlite3\"" >> .env.test
- name: Create a test results directory
run: mkdir test-results

- name: Run tests
run: |
go test "./..." -coverprofile="coverage.out" -covermode=count -json > test-report.out
go test "./..." -coverprofile="test-results/coverage.out" -covermode=count -json > test-results/test-report.out
- name: Delete the .env.test file after tests are completed
run: rm .env.test

- uses: actions/upload-artifact@v4
with:
name: test-results
path: |
coverage.out
test-report.out
path: test-results/

sonar-scan:
name: "SonarQube Scan"
Expand Down
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=**/vendor/**

sonar.go.tests.reportPaths=test-report.out
sonar.go.coverage.reportPaths=coverage.out
sonar.go.tests.reportPaths=test-results/test-report.out
sonar.go.coverage.reportPaths=test-results/coverage.out

0 comments on commit 3edd025

Please sign in to comment.