Skip to content

Merge pull request #59 from vil02/renovate/lycheeverse-lychee-action-2.x #119

Merge pull request #59 from vil02/renovate/lycheeverse-lychee-action-2.x

Merge pull request #59 from vil02/renovate/lycheeverse-lychee-action-2.x #119

---
name: sonarcloud_check
'on':
workflow_dispatch:
push:
branches:
- master
pull_request:
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Generate coverage data
run: |
coverage run --branch -m pytest
coverage xml --omit="*/test_*"
coverage report --omit="*/test_*"
- name: Fix code coverage paths for SonarCloud
# yamllint disable rule:line-length
run: |
cp coverage.xml coverage_for_sonacloud.xml
sed -i 's/\/home\/runner\/work\/pi2021\/pi2021/\/github\/workspace/g' coverage_for_sonacloud.xml
# yamllint enable rule:line-length
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
...