1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
name: CI
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install automake autoconf libtool build-essential patch perl libc-bin libunwind-dev
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install pprof
run: |
go install github.com/google/pprof@latest
echo "PATH=$HOME/go/bin:$PATH" >> $GITHUB_ENV
- run: echo GPERFTOOLS_ENSURE_PACKAGE_VERSION=1 >> $GITHUB_ENV
- name: Build and test
run: |
./autogen.sh
./configure
export NUMCPUS=`getconf _NPROCESSORS_ONLN`
export MORECPUS="$(($NUMCPUS * 3))"
printf "NUMCPUS=%d MORECPUS=%d\n" "$NUMCPUS" "$MORECPUS"
make "-j${NUMCPUS}"
make "-j${MORECPUS}" check || make "-j${MORECPUS}" recheck
# A number of features in gperftools is optional. Lets make
# sure that on a common x86/Linux platform all the optional
# pieces are actually convigured and built. See
# e1f821e56f80ad63d37407267e0022b9ca07a458 for the curious
# example of how things could be subtly broken.
#
# getpc_test is proxy for libprofiler being enabled
./getpc_test
# Ensure that debugallocator is present as well.
./tcmalloc_minimal_debug_unittest
./tcmalloc_debug_unittest
# Verify that heap profiler is built and works.
./heap-profiler_unittest
- name: Upload Test Logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-logs-${{ github.job }}
retention-days: 7
path: |
*.log
test-i386:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install automake autoconf libtool build-essential patch perl libc-bin g++-multilib
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install pprof
run: |
go install github.com/google/pprof@latest
echo "PATH=$HOME/go/bin:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.os }}
- name: Add ccache to PATH
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
# when testing autotools-based build ensure that we check PACKAGE_VERSION matches versions in tcmalloc.h
- run: echo GPERFTOOLS_ENSURE_PACKAGE_VERSION=1 >> $GITHUB_ENV
- name: Build and test
# GNU/Linux i386 currently fails with libgcc backtracer due to wrong unwind info in memcpy-ia32.S. So we force frame pointers.
run: |
./autogen.sh
./configure CXX='g++ -m32' CC='gcc -m32' --enable-frame-pointers
export NUMCPUS=`getconf _NPROCESSORS_ONLN`
export MORECPUS="$(($NUMCPUS * 3))"
printf "NUMCPUS=%d MORECPUS=%d\n" "$NUMCPUS" "$MORECPUS"
make "-j${NUMCPUS}"
make "-j${MORECPUS}" check || make "-j${MORECPUS}" recheck
# Ensure that notable optional features are built and work.
./getpc_test
./tcmalloc_minimal_debug_unittest
./tcmalloc_debug_unittest
./heap-profiler_unittest
- name: Upload Test Logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-logs-${{ github.job }}
retention-days: 7
path: |
*.log
test-cmake:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
build_type: [RelWithDebInfo, Debug]
runs-on: ${{ matrix.os }}
steps:
- name: Clone
uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@v5
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }}
- name: Add ccache to PATH
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install pprof
run: |
go install github.com/google/pprof@latest
echo "PATH=$HOME/go/bin:$PATH" >> $GITHUB_ENV
PATH=$HOME/go/bin:$PATH which -a pprof
- name: mkdir build/
run: cmake -E make_directory ${{runner.workspace}}/build
- name: cmake setup
working-directory: ${{runner.workspace}}/build
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja $GITHUB_WORKSPACE
- name: cmake build
working-directory: ${{runner.workspace}}/build
run: ninja -v
- name: test
working-directory: ${{runner.workspace}}/build
run: ctest -j12 --test-dir . || ctest -j12 --test-dir . --rerun-failed
- name: Upload Test Logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-logs-${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }}
retention-days: 7
path: |
${{runner.workspace}}/build/Testing/Temporary/LastTest.log
test-cmake-windows:
strategy:
matrix:
os: [windows-latest]
build_type: [RelWithDebInfo, Debug]
runs-on: ${{ matrix.os }}
steps:
- name: Clone
uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@v5
- name: mkdir build/
run: cmake -E make_directory ${{runner.workspace}}/build
- name: cmake setup
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
ruby $GITHUB_WORKSPACE/.github/workflows/scripts/msvc-env.rb cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja -DGPERFTOOLS_BUILD_HEAP_PROFILER=OFF -Dgperftools_build_minimal=ON $GITHUB_WORKSPACE
- name: cmake build
working-directory: ${{runner.workspace}}/build
shell: bash
run: ruby $GITHUB_WORKSPACE/.github/workflows/scripts/msvc-env.rb ninja -v
- name: test
working-directory: ${{runner.workspace}}/build
env:
CTEST_PARALLEL_LEVEL: 12
run: ninja -v test
- name: Upload Test Logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-logs-${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }}
retention-days: 7
path: |
${{runner.workspace}}/build/Testing/Temporary/LastTest.log
|