Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/cron-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
codecov:
name: Collect code coverage data
runs-on: ubuntu-latest
timeout-minutes: 350
# Disable this scheduled job when running on a fork.
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
env:
Expand All @@ -41,23 +42,26 @@ jobs:

- run: sudo apt-get update && sudo apt-get -y install lcov

# llvm-cov of a debug binary makes `-m test -u all` take many hours per
# dozen tests. Release + per-test timeout keeps the job under 6h.
- name: Run cargo-llvm-cov with Rust tests.
run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi --verbose --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls-aws-lc,jit,host_env
run: cargo llvm-cov --no-report --release --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi --verbose --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls-aws-lc,jit,host_env

- name: Run cargo-llvm-cov with Python snippets.
run: python scripts/cargo-llvm-cov.py
continue-on-error: true

- name: Run cargo-llvm-cov with Python test suite.
run: cargo llvm-cov --no-report run -- -m test -u all --slowest --fail-env-changed
timeout-minutes: 180
run: cargo llvm-cov --no-report --release run -- -m test -u all --timeout 120 --slowest --fail-env-changed -j0
continue-on-error: true

- name: Prepare code coverage data
run: cargo llvm-cov report --lcov --output-path='codecov.lcov'

- name: Upload to Codecov
if: ${{ github.event_name != 'pull_request' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
uses: codecov/codecov-action@0b35c9ecc4f0529d0eb674914510c22f85b196b4 # v7.1.0
with:
files: ./codecov.lcov

Expand Down
10 changes: 9 additions & 1 deletion scripts/cargo-llvm-cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
def run_llvm_cov(file_path: str):
"""Run cargo llvm-cov on a file."""
if file_path.endswith(".py"):
command = ["cargo", "llvm-cov", "--no-report", "run", "--", file_path]
command = [
"cargo",
"llvm-cov",
"--no-report",
"--release",
"run",
"--",
file_path,
]
subprocess.call(command)


Expand Down
Loading