fix coverage in sonarqube
All checks were successful
check code / scan-code-py311 (pull_request) Has been skipped
build package and container / build-pypackage (pull_request) Successful in 15s
check code / check-docs (pull_request) Successful in 7s
build package and container / build-container (pull_request) Successful in 4m54s
check code / check-code-py38 (pull_request) Successful in 6m51s
check code / check-code-py310 (pull_request) Successful in 6m46s
check code / check-code-py39 (pull_request) Successful in 6m58s
create release / release-pypackage (pull_request) Successful in 25s
check code / check-code-py311 (pull_request) Successful in 7m6s

This commit is contained in:
Ivan Schaller 2024-02-01 15:43:04 +01:00
parent 7160e1b2a5
commit 9b83373450
2 changed files with 39 additions and 16 deletions

View file

@ -10,12 +10,24 @@ on:
jobs: jobs:
build-pypackage: build-pypackage:
uses: actions/workflows/.gitea/workflows/release_pypackage.yml@master runs-on: python311
with: env:
repository: main HATCH_INDEX_REPO: main
secrets: HATCH_INDEX_USER: __token__
username: __token__ HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
token: ${{ secrets.PYPI_TOKEN }} steps:
- name: checkout code
uses: actions/checkout@v3
- name: install hatch
run: pip install -U hatch hatchling
- name: build package
run: hatch build --clean
- name: publish package
if: gitea.event_name != 'pull_request'
run: hatch publish --yes --no-prompt
build-container: build-container:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -8,16 +8,6 @@ on:
branches: [main, master] branches: [main, master]
jobs: jobs:
scan-code-py311:
uses: actions/workflows/.gitea/workflows/sonarqube_python.yml@master
needs: [check-code]
if: gitea.event_name != 'pull_request'
with:
run-coverage: true
secrets:
sonar-host: ${{ secrets.SONARQUBE_HOST }}
sonar-token: ${{ secrets.SONARQUBE_TOKEN }}
check-docs: check-docs:
runs-on: python311 runs-on: python311
steps: steps:
@ -30,6 +20,27 @@ jobs:
cd docs || exit 1 cd docs || exit 1
mkdocs build --strict mkdocs build --strict
scan-code-py311:
runs-on: python311
if: gitea.event_name != 'pull_request'
steps:
- name: checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install hatch
run: pip install -U hatch
- name: get coverage (hatch)
run: hatch run default:cov
- name: run sonar-scanner
uses: sonarsource/sonarqube-scan-action@v2.0.1
env:
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
check-code-py38: check-code-py38:
runs-on: python38 runs-on: python38
steps: steps: