Skip to content

Commit

Permalink
Fix file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Apr 23, 2024
1 parent ba85175 commit e9ec9a8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ defaults:
env:
RUSTFLAGS: '-C instrument-coverage --cfg=coverage --cfg=coverage_nightly --cfg=trybuild_no_target'
RUST_BACKTRACE: 1
LLVM_PROFILE_FILE: '/Users/runner/work/polars/polars/target/polars-%p-%3m.profraw'
LLVM_PROFILE_FILE: ${{ github.workspace }}/target/polars-%p-%3m.profraw
CARGO_LLVM_COV: 1
CARGO_LLVM_COV_SHOW_ENV: 1
CARGO_LLVM_COV_TARGET_DIR: '/Users/runner/work/polars/polars/target'
CARGO_LLVM_COV_TARGET_DIR: ${{ github.workspace }}/target

jobs:
coverage-rust:
# Running under ubuntu doesn't seem to work:
# https://github.com/pola-rs/polars/issues/14255
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -72,17 +74,23 @@ jobs:
run: cargo llvm-cov report --lcov --output-path coverage-rust.lcov

- name: Upload coverage report
uses: actions/upload-artifact@v4
uses: codecov/codecov-action@v4
with:
name: coverage-rust
path: coverage-rust.lcov
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-rust.lcov
root_dir: ${{ github.workspace }}
flags: rust
fail_ci_if_error: true

coverage-python:
# Running under ubuntu doesn't seem to work:
# https://github.com/pola-rs/polars/issues/14255
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down Expand Up @@ -123,32 +131,26 @@ jobs:
working-directory: py-polars
env:
POLARS_FORCE_ASYNC: 1
run: pytest --cov -m "not release and not benchmark and not docs" tests/unit/io/ --cov-report xml:async.xml
run: pytest --cov -n auto --dist loadgroup -m "not release and not benchmark and not docs" tests/unit/io/ --cov-report xml:async.xml
continue-on-error: true

- name: Report Rust coverage
run: cargo llvm-cov report --lcov --output-path coverage-python.lcov

- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-python
path: |
coverage-python.lcov
py-polars/main.xml
py-polars/async.xml
upload-coverage:
needs: [coverage-rust, coverage-python]
runs-on: ubuntu-latest
steps:
- name: Download coverage files
uses: actions/download-artifact@v4
- name: Upload coverage reports - Python
uses: codecov/codecov-action@v4
with:
merge-multiple: true
token: ${{ secrets.CODECOV_TOKEN }}
files: py-polars/main.xml,py-polars/async.xml
root_dir: ${{ github.workspace }}/py-polars
flags: python
fail_ci_if_error: true

- name: Upload coverage information
- name: Upload coverage report - Rust
uses: codecov/codecov-action@v4
with:
files: coverage-rust.lcov,coverage-python.lcov,main.xml,async.xml
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-python.lcov
root_dir: ${{ github.workspace }}
flags: rust
fail_ci_if_error: true
5 changes: 4 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ coverage:
status:
project: off
patch: off
comment:
layout: "header, files, footer"
require_changes: true
after_n_builds: 4
ignore:
- crates/polars-arrow/src/io/flight/*.rs
- crates/polars-arrow/src/io/ipc/append/*.rs
Expand All @@ -16,4 +20,3 @@ ignore:
- crates/polars-arrow/src/array/union/*.rs
- crates/polars-arrow/src/array/map/*.rs
- crates/polars-arrow/src/array/fixed_size_binary/*.rs

0 comments on commit e9ec9a8

Please sign in to comment.