From be7097e4f2dfcd33c484bd5ec3daa2122b0f260d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perceval=20Wajsb=C3=BCrt?= Date: Wed, 15 May 2024 04:57:42 +0200 Subject: [PATCH] chore: drop codecov --- .github/workflows/tests.yml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2175154..786e177 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: Tests and Linting on: pull_request: push: - branches: [main] + branches: [ main ] jobs: Linting: @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v2 - name: Cache downloaded resources @@ -80,10 +80,6 @@ jobs: pattern: coverage-data-* merge-multiple: true - - uses: actions/download-artifact@v4 - with: - pattern: main-coverage - - name: Combine coverage run: | python -Im pip install --upgrade "git+https://github.com/percevalw/coveragepy.git#egg=coverage[toml]" @@ -97,6 +93,12 @@ jobs: # Get the main branch, so that we can run `git diff main` git fetch origin main:main --depth=1 + # We share store main coverage data in a separate branch, so we fetch it too + git fetch origin __main_coverage__:__main_coverage__ --depth=1 || true + + # Get the coverage data from the __main_coverage__ branch + git checkout __main_coverage__ -- main-coverage.txt || true + # Report and write to summary. echo '## Coverage Report' > report.md @@ -148,24 +150,32 @@ jobs: pattern: coverage-data-* merge-multiple: true + - name: Set up Git + run: | + git config user.name ${{ github.actor }} + git config user.email ${{ github.actor }}@users.noreply.github.com + - name: Combine coverage run: | python -Im pip install --upgrade "git+https://github.com/percevalw/coveragepy.git#egg=coverage[toml]" python -Im coverage combine - coverage report --show-missing > main-coverage.txt + coverage report --show-missing > /tmp/main-coverage.txt - - name: Upload Coverage Percentage for Main - uses: actions/upload-artifact@v4 - with: - name: main-coverage - path: main-coverage.txt + # Upload to the __main_coverage__ branch + git fetch origin __main_coverage__:__main_coverage__ --depth=1 || true + git checkout __main_coverage__ || git checkout -b __main_coverage__ --orphan + git reset --hard + cp /tmp/main-coverage.txt main-coverage.txt + git add main-coverage.txt + git commit -m "Update main coverage data" + git push origin __main_coverage__ Installation: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2