Skip to content

Commit

Permalink
chore: drop codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed May 15, 2024
1 parent 4809aed commit be7097e
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tests and Linting
on:
pull_request:
push:
branches: [main]
branches: [ main ]

jobs:
Linting:
Expand All @@ -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
Expand Down Expand Up @@ -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]"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit be7097e

Please sign in to comment.