Skip to content

Commit

Permalink
changed working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeev-flexion committed May 24, 2024
1 parent 5e3601c commit bb22e14
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,38 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('src/report-stream/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
cd src/report-stream
go mod tidy
go mod download
- name: Install SonarQube Scanner
run: |
curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner.zip -d $HOME
export PATH="$HOME/sonar-scanner-4.6.2.2472-linux/bin:$PATH"
echo "$HOME/sonar-scanner-4.6.2.2472-linux/bin" >> $GITHUB_PATH
- name: Run tests and generate coverage
run: |
cd src/report-stream
go test -v ./... -coverprofile=coverage.out
cat coverage.out
go tool cover -func=coverage.out
- name: SonarQube Scan
env:
SONAR_TOKEN: ${{ secrets.SFTP_INGESTION_SONAR_TOKEN }}
run: |
cd src/report-stream
sonar-scanner \
-Dsonar.projectKey=CDCgov_reportstream-sftp-ingestion \
-Dsonar.organization=cdcgov \ # For SonarCloud only
-Dsonar.host.url=https://sonarcloud.io \ # Use your SonarQube URL if using SonarQube
-Dsonar.organization=cdcgov \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.sources=. \
-Dsonar.tests=. \
Expand Down

0 comments on commit bb22e14

Please sign in to comment.