refactor: attempt to make sonarcloud scan with a github token #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SonarCloud | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
sonarqube: | |
name: SonarQube | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- name: Install ciscoconfparse2 | |
run: pip install . | |
- name: Install coverage | |
run: pip install coverage==5.0.0 | |
- name: Install pytest | |
run: pip install pytest | |
- name: Run coverage | |
run: cd tests && coverage run -m pytest | |
- name: Generate xml | |
run: cd tests && coverage xml -o coverage.xml | |
- name: Relocate the coverage report | |
run: mv tests/coverage.xml coverage.xml | |
- name: SonarQube Scan | |
uses: SonarSource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |