Skip to content

Commit

Permalink
test: sonar config
Browse files Browse the repository at this point in the history
  • Loading branch information
daithihearn committed Oct 3, 2023
1 parent 201b4eb commit 5b2e299
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,19 @@ jobs:
run: yarn install --frozen-lockfile
- name: Test and coverage
run: yarn jest --coverage
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Sonar Args
id: sonar-args
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
echo "SONAR_ARGS=-Dsonar.branch.name=main" >> $GITHUB_OUTPUT
else
echo "SONAR_ARGS=-Dsonar.branch.target=main -Dsonar.branch.name=${{ github.head_ref }}" >> $GITHUB_OUTPUT
fi
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: ${{ steps.sonar-args.outputs.SONAR_ARGS }}

0 comments on commit 5b2e299

Please sign in to comment.