From 9b8337345064d80ccf08963b9c7ab33d68aae939 Mon Sep 17 00:00:00 2001 From: olofvndrhr Date: Thu, 1 Feb 2024 15:43:04 +0100 Subject: [PATCH] fix coverage in sonarqube --- .gitea/workflows/build.yml | 24 ++++++++++++++++++------ .gitea/workflows/check_code.yml | 31 +++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9a210f4..b139fd5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,12 +10,24 @@ on: jobs: build-pypackage: - uses: actions/workflows/.gitea/workflows/release_pypackage.yml@master - with: - repository: main - secrets: - username: __token__ - token: ${{ secrets.PYPI_TOKEN }} + runs-on: python311 + env: + HATCH_INDEX_REPO: main + HATCH_INDEX_USER: __token__ + HATCH_INDEX_AUTH: ${{ 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: runs-on: ubuntu-latest diff --git a/.gitea/workflows/check_code.yml b/.gitea/workflows/check_code.yml index 38ec980..785127c 100644 --- a/.gitea/workflows/check_code.yml +++ b/.gitea/workflows/check_code.yml @@ -8,16 +8,6 @@ on: branches: [main, master] 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: runs-on: python311 steps: @@ -30,6 +20,27 @@ jobs: cd docs || exit 1 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: runs-on: python38 steps: