From 707f6d88198cd545b70d6b7412645b6666db6678 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Fri, 30 Aug 2024 20:31:45 +0000 Subject: [PATCH 1/3] chore: enable codecov reporting This is shamelessly borrowed from our code in the kernel repo --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93b3cbdc3e..264ef4b0c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,31 @@ jobs: - name: Format run: cargo fmt -- --check + coverage: + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v4 + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + profile: default + toolchain: stable + override: true + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - uses: Swatinem/rust-cache@v2 + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json -- --skip read_table_version_hdfs + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: codecov.json + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + build: strategy: fail-fast: false From d99493c65f365c6d18f4174792403bf90c31db44 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Fri, 30 Aug 2024 22:45:26 +0000 Subject: [PATCH 2/3] Clean up the actions file to build codecov with the same features --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 264ef4b0c9..e6ec18bef7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,9 @@ on: branches: [main, "rust-v*"] merge_group: +env: + DEFAULT_FEATURES: "azure,datafusion,s3,gcs,glue,hdfs " + jobs: format: runs-on: ubuntu-latest @@ -39,7 +42,7 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - uses: Swatinem/rust-cache@v2 - name: Generate code coverage - run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json -- --skip read_table_version_hdfs + run: cargo llvm-cov --features ${DEFAULT_FEATURES} --workspace --codecov --output-path codecov.json -- --skip read_table_version_hdfs - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: @@ -68,13 +71,13 @@ jobs: override: true - name: build and lint with clippy - run: cargo clippy --features azure,datafusion,s3,gcs,glue,hdfs --tests + run: cargo clippy --features ${DEFAULT_FEATURES} --tests - name: Spot-check build for native-tls features run: cargo clippy --no-default-features --features azure,datafusion,s3-native-tls,gcs,glue --tests - name: Check docs - run: cargo doc --features azure,datafusion,s3,gcs,glue,hdfs + run: cargo doc --features ${DEFAULT_FEATURES } - name: Check no default features (except rustls) run: cargo check --no-default-features --features rustls @@ -105,7 +108,7 @@ jobs: override: true - name: Run tests - run: cargo test --verbose --features datafusion,azure + run: cargo test --verbose --features ${DEFAULT_FEATURES} integration_test: name: Integration Tests @@ -155,7 +158,7 @@ jobs: - name: Run tests with rustls (default) run: | - cargo test --features integration_test,azure,s3,gcs,datafusion,hdfs + cargo test --features integration_test,${DEFAULT_FEATURES} - name: Run tests with native-tls run: | From ea82775de2683f1a49d07176b3595253d315fa72 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Fri, 30 Aug 2024 22:52:31 +0000 Subject: [PATCH 3/3] use github's interpolation to be windows compatible --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6ec18bef7..d67faa62c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,13 +71,13 @@ jobs: override: true - name: build and lint with clippy - run: cargo clippy --features ${DEFAULT_FEATURES} --tests + run: cargo clippy --features ${{ env.DEFAULT_FEATURES }} --tests - name: Spot-check build for native-tls features run: cargo clippy --no-default-features --features azure,datafusion,s3-native-tls,gcs,glue --tests - name: Check docs - run: cargo doc --features ${DEFAULT_FEATURES } + run: cargo doc --features ${{ env.DEFAULT_FEATURES }} - name: Check no default features (except rustls) run: cargo check --no-default-features --features rustls @@ -108,7 +108,7 @@ jobs: override: true - name: Run tests - run: cargo test --verbose --features ${DEFAULT_FEATURES} + run: cargo test --verbose --features ${{ env.DEFAULT_FEATURES }} integration_test: name: Integration Tests @@ -158,7 +158,7 @@ jobs: - name: Run tests with rustls (default) run: | - cargo test --features integration_test,${DEFAULT_FEATURES} + cargo test --features integration_test,${{ env.DEFAULT_FEATURES }} - name: Run tests with native-tls run: |