Coverage report using Codecov workflow (holgern/pyedflib)
The Coverage report using Codecov workflow from holgern/pyedflib, explained and optimized by Latchkey.
CI health: F - at risk
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Coverage report using Codecov workflow from the holgern/pyedflib repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Coverage report using Codecov
on: [push]
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
env:
OS: ${{ matrix.os }}
PYTHON: '3.9'
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pip install -e .
pip install -r requirements-test.txt
pytest --cov=./pyedflib/ --cov-report=xml --cov-config=.coveragerc
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
directory: .
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
move_coverage_to_trash: true
flags: unittests
name: codecov-umbrella
verbose: true
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Coverage report using Codecov on: [push] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: run: timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] env: OS: ${{ matrix.os }} PYTHON: '3.9' steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: cache: 'pip' python-version: 3.9 - name: Generate coverage report run: | pip install pytest pip install pytest-cov pip install -e . pip install -r requirements-test.txt pytest --cov=./pyedflib/ --cov-report=xml --cov-config=.coveragerc - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: directory: . env_vars: OS,PYTHON fail_ci_if_error: true files: ./coverage.xml move_coverage_to_trash: true flags: unittests name: codecov-umbrella verbose: true
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.