Skip to content

task(ci): add sonar #162

task(ci): add sonar

task(ci): add sonar #162

Workflow file for this run

---
name: Code Coverage Check
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up poetry and install
uses: ./.github/actions/setup-poetry
with:
python-version: "3.9"
- name: Run tests
run: make test-code-cov
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage.xml
sonarcloud:
if: ${{ github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url }}
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- 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 }}