diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 07ca0fc05..0e8bf5183 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,3 +45,5 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check workflow files uses: reviewdog/action-actionlint@1f3610e92fa221aa2b7c1756bccf5437efd416a4 # v1.70.0 + with: + fail_level: error diff --git a/.github/workflows/pytest-cov.yml b/.github/workflows/pytest-cov.yml index 4a9e92ecf..86037764a 100644 --- a/.github/workflows/pytest-cov.yml +++ b/.github/workflows/pytest-cov.yml @@ -35,13 +35,33 @@ jobs: - name: Install dependencies and library run: poetry install - name: Run tests with coverage - run: poetry run pytest --cov --junitxml=junit.xml -o junit_family=legacy - - name: Upload coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + run: poetry run pytest --cov --cov-report=xml:coverage.xml --junitxml=junit.xml -o junit_family=legacy + - name: Upload coverage artifact + if: ${{ matrix.python-version == '3.12' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} + uses: actions/upload-artifact@v7 with: - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload test results to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1 + name: coverage-report-python-${{ matrix.lib }} + path: ${{ matrix.lib }}/coverage.xml + + upload-coverage-python: + needs: pytest-cov + if: !cancelled() && needs.pytest-cov.result == 'success' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + runs-on: ubuntu-latest + permissions: + contents: read + strategy: + matrix: + lib: + - scaleway-core + - scaleway + - scaleway-async + steps: + - name: Download coverage artifact + uses: actions/download-artifact@v8 + with: + name: coverage-report-python-${{ matrix.lib }} + - uses: actions/upload-code-coverage@v1 with: - token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml + language: Python + label: code-coverage-agent diff --git a/.gitignore b/.gitignore index 7c93a5488..9df20798f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,8 @@ dist/ # macOS .DS_Store + +# Coverage reports +coverage.xml +.coverage +htmlcov/