From 9204dd4bfe47080eead32a3ffadd40418c1b0e53 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Thu, 3 Aug 2023 12:00:54 -0700 Subject: [PATCH 1/2] Valgrind in CI --- .github/workflows/valgrind.yml | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/valgrind.yml diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml new file mode 100644 index 000000000..d6f8d1a8d --- /dev/null +++ b/.github/workflows/valgrind.yml @@ -0,0 +1,72 @@ + +name: Test PGRX under valgrind + +permissions: + contents: read + +on: + # Run nightly + schedule: + - cron: '0 1 * * *' + # TODO: optionally take a specific SHA maybe? + workflow_dispatch: + # DONOTLAND just for testing during dev + pull_request: + +env: + RUST_BACKTRACE: '1' + CARGO_INCREMENTAL: '0' + +jobs: + valgrind: + name: Valgrind tests ${{ matrix.pg_version }} + strategy: + fail-fast: false # We want all of them to run, even if one fails + matrix: + pg_version: ["pg11", "pg12", "pg13", "pg14", "pg15", "pg16"] + + # FIXME: PGRX? + runs-on: ubuntu-latest + + steps: + - name: 'Install system dependencies' + run: | + sudo apt-get update && sudo apt-get install -y \ + build-essential \ + bzip2 \ + clang \ + libclang-dev \ + llvm \ + cmake \ + libz-dev \ + zlib1g-dev \ + libssl-dev \ + pkg-config \ + libreadline-dev \ + libicu-dev \ + bison \ + flex \ + valgrind + + - name: 'Setup Rust' + run: | + rustup toolchain install stable + rustup default stable + + # I don't think we need to explicitly checkout a branch now that we have + # `develop` as default. + - uses: actions/checkout@v3 + + - run: 'cargo install --path cargo-pgrx/ --debug --force' + + - name: 'Download and compile ${{ matrix.pg_version }} (asserts and valgrind)' + run: 'cargo pgrx init --valgrind --${{ matrix.pg_version }}=download' + + - name: Run tests (no cshim) + run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }}" --verbose' + + - name: Run tests (with cshim) + run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }} cshim" --verbose' + + - name: Run tests (with cshim and pg_test?) + run: 'env USE_VALGRIND=1 cargo test --all --no-default-features --features="${{ matrix.pg_version }} cshim pg_test" --verbose' From eb5027afa3a2a2e9b1ca01da5b4eac55a6e9a7e5 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Thu, 3 Aug 2023 14:11:04 -0700 Subject: [PATCH 2/2] brady was right! --- .github/workflows/valgrind.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index d6f8d1a8d..c2c38fe24 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -62,11 +62,9 @@ jobs: - name: 'Download and compile ${{ matrix.pg_version }} (asserts and valgrind)' run: 'cargo pgrx init --valgrind --${{ matrix.pg_version }}=download' - - name: Run tests (no cshim) - run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }}" --verbose' + - run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }} cshim" --verbose' + # :(... + - run: cargo clean - - name: Run tests (with cshim) - run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }} cshim" --verbose' + - run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }}" --verbose' - - name: Run tests (with cshim and pg_test?) - run: 'env USE_VALGRIND=1 cargo test --all --no-default-features --features="${{ matrix.pg_version }} cshim pg_test" --verbose'