Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valgrind in CI #1248

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
70 changes: 70 additions & 0 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

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'

- run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }} cshim" --verbose'
# :(...
- run: cargo clean

- run: 'env USE_VALGRIND=1 cargo test --no-default-features --features="${{ matrix.pg_version }}" --verbose'