Skip to content

feat(d2e-compat): run the d2e stack on trex's canonical main #224

feat(d2e-compat): run the d2e stack on trex's canonical main

feat(d2e-compat): run the d2e stack on trex's canonical main #224

Workflow file for this run

name: Coverage
on:
push:
branches: [main, develop]
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
branches: [main, develop]
workflow_dispatch:
permissions: read-all
concurrency:
group: coverage-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rust-unit-coverage:
name: "Rust unit coverage (${{ matrix.plugin }})"
runs-on: ubuntu-24.04
timeout-minutes: 40
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
strategy:
fail-fast: false
matrix:
plugin: [chdb, db, etl, fhir, hana, migration, pg_trex, pgt, pgwire, pool, runtime, tpm, transform]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/checkout-trex
with:
paths: ${{ matrix.plugin == 'runtime' && 'plugins/extension-ci-tools plugins/runtime/trex-runtime' || 'plugins/extension-ci-tools' }}
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
plugins/${{ matrix.plugin }}/target
key: coverage-${{ matrix.plugin }}-${{ runner.os }}-${{ hashFiles(format('plugins/{0}/Cargo.lock', matrix.plugin)) }}
restore-keys: coverage-${{ matrix.plugin }}-${{ runner.os }}-
- name: Install PostgreSQL 17 dev headers (pg_trex only)
if: matrix.plugin == 'pg_trex'
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
sudo apt-get update
sudo apt-get install -y postgresql-17 postgresql-server-dev-17
- uses: ./.github/actions/setup-libtrexsql
if: matrix.plugin == 'pg_trex'
with:
version: v1.4.4-trex
- name: Install cargo-pgrx (pg_trex only)
if: matrix.plugin == 'pg_trex'
uses: taiki-e/install-action@v2
with:
tool: cargo-pgrx@0.16.1
- name: pgrx init (pg_trex only)
if: matrix.plugin == 'pg_trex'
run: cargo pgrx init --pg17=$(which pg_config)
- name: Install chdb native lib
if: matrix.plugin == 'chdb'
run: sudo apt-get update && sudo apt-get install -y libc6-dev clang && sudo bash ./install_chdb.sh
working-directory: plugins/chdb
- name: Install trexas build deps
if: matrix.plugin == 'runtime'
run: sudo apt-get update && sudo apt-get install -y libopenblas-dev
# The Run coverage steps below are intentionally continue-on-error: true.
# Coverage reporting is informational — latent failures in plugin test
# suites that never ran in CI before must surface without blocking the
# PR. Remove the flag per-plugin as each suite is stabilized.
- name: Run coverage (pg_trex)
if: matrix.plugin == 'pg_trex'
continue-on-error: true
run: |
mkdir -p build/coverage
LIBRARY_PATH=/tmp/trexsql cargo llvm-cov --lcov --output-path build/coverage/lcov.info
working-directory: plugins/pg_trex
- name: Run coverage (pgt)
if: matrix.plugin == 'pgt'
continue-on-error: true
run: |
mkdir -p build/coverage
cargo llvm-cov --lcov --output-path build/coverage/lcov.info
working-directory: plugins/pgt
- name: Run coverage (other plugins)
if: matrix.plugin != 'pg_trex' && matrix.plugin != 'pgt'
continue-on-error: true
run: make coverage
working-directory: plugins/${{ matrix.plugin }}
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: plugins/${{ matrix.plugin }}/build/coverage/lcov.info
flags: unit-${{ matrix.plugin }}
fail_ci_if_error: false
coverage-status:
name: "Coverage Status"
if: always()
runs-on: ubuntu-24.04
timeout-minutes: 5
needs: [rust-unit-coverage]
steps:
- name: Check
run: |
echo "rust-unit-coverage: ${{ needs.rust-unit-coverage.result }}"
# Coverage is informational only — never fail the gate. The job
# still appears in PR checks so missing uploads are visible.
exit 0
ratchet:
name: "Coverage ratchet"
runs-on: ubuntu-24.04
timeout-minutes: 30
needs: rust-unit-coverage
if: github.event_name == 'pull_request'
continue-on-error: true # informational until we have one week of green runs
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- run: sudo apt-get update && sudo apt-get install -y jq
- run: scripts/coverage-summary.sh coverage/current.json
- run: python3 scripts/coverage-ratchet.py coverage/current.json