Skip to content

Test cygwin in ci and fix build #668

Test cygwin in ci and fix build

Test cygwin in ci and fix build #668

Workflow file for this run

name: ci
on:
push:
pull_request:
jobs:
test-linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
shared: [--shared, ""]
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev ninja-build ccache
pip3 install colorama
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-test-linux-${{ runner.arch }}-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-test-linux-${{ runner.arch }}-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config ${{matrix.shared}}
test-linux-arm:
runs-on: ubuntu-22.04-arm
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
shared: [--shared, ""]
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev ninja-build
pip3 install colorama
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: build and test
run: |
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config ${{matrix.shared}}
test-macos:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
shared: [--shared, ""]
steps:
- uses: actions/checkout@v4
- name: gcc
run: brew install gcc@12 ccache
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: dependencies
run: |
python3 -m venv env
env/bin/pip install colorama
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-test-macos-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-test-macos-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
env/bin/python ci/test-all-configs.py --${{matrix.compiler}} --default-config ${{matrix.shared}}
test-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler: [msvc, clang, gcc]
shared: [--shared, ""]
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: dependencies
run: |
pip3 install colorama
- name: Resolve prereqs path
if: matrix.compiler == 'gcc'
id: prereqs-path
run: echo "dir=$((Resolve-Path ..).Path)" >> $env:GITHUB_OUTPUT
- name: Cache prerequisites
if: matrix.compiler == 'gcc'
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-mingw-${{ hashFiles('ci/setup-prerequisites-mingw.ps1') }}
- name: libdwarf
run: |
if("${{matrix.compiler}}" -eq "gcc") {
cd ..
cpptrace/ci/setup-prerequisites-mingw.ps1
}
- name: build and test
run: |
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config ${{matrix.shared}}
test-windows-old:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler: [msvc]
shared: [--shared, ""]
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
toolset: 14.29 # vc 2019
- name: dependencies
run: |
pip3 install colorama
- name: libdwarf
run: |
if("${{matrix.compiler}}" -eq "gcc") {
cd ..
cpptrace/ci/setup-prerequisites-mingw.ps1
}
- name: build and test
run: |
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config ${{matrix.shared}}
test-linux-all-configurations:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
shared: [--shared, ""]
needs: test-linux
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev ninja-build ccache
pip3 install colorama
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-test-linux-${{ runner.arch }}-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-test-linux-${{ runner.arch }}-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
python3 ci/test-all-configs.py --${{matrix.compiler}} ${{matrix.shared}}
test-macos-all-configurations:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
shared: [--shared, ""]
needs: test-macos
steps:
- uses: actions/checkout@v4
- name: gcc
run: brew install gcc@12 ccache
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: dependencies
run: |
python3 -m venv env
env/bin/pip install colorama
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-test-macos-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-test-macos-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
env/bin/python ci/test-all-configs.py --${{matrix.compiler}} ${{matrix.shared}}
test-windows-all-configurations:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler: [msvc, clang, gcc]
shared: [--shared, ""]
needs: test-windows
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: dependencies
run: |
pip3 install colorama
- name: Resolve prereqs path
if: matrix.compiler == 'gcc'
id: prereqs-path
run: echo "dir=$((Resolve-Path ..).Path)" >> $env:GITHUB_OUTPUT
- name: Cache prerequisites
if: matrix.compiler == 'gcc'
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-mingw-${{ hashFiles('ci/setup-prerequisites-mingw.ps1') }}
- name: libdwarf
run: |
if("${{matrix.compiler}}" -eq "gcc") {
cd ..
cpptrace/ci/setup-prerequisites-mingw.ps1
}
- name: build and test
run: |
python3 ci/test-all-configs.py --${{matrix.compiler}} ${{matrix.shared}}
build-linux-all-remaining-configurations:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
needs: test-linux-all-configurations
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev ninja-build ccache
pip3 install colorama
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-test-linux-${{ runner.arch }}-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-test-linux-${{ runner.arch }}-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build
run: |
python3 ci/build-in-all-remaining-configs.py --${{matrix.compiler}}
build-macos-all-remaining-configurations:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
needs: test-macos-all-configurations
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
brew install gcc@12 ninja ccache
python3 -m venv env
env/bin/pip install colorama
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites.sh') }}
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-test-macos-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-test-macos-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build
run: |
env/bin/python ci/build-in-all-remaining-configs.py --${{matrix.compiler}}
build-windows-all-remaining-configurations:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler: [msvc, clang, gcc]
needs: test-windows-all-configurations
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: dependencies
run: |
pip3 install colorama
- name: Resolve prereqs path
if: matrix.compiler == 'gcc'
id: prereqs-path
run: echo "dir=$((Resolve-Path ..).Path)" >> $env:GITHUB_OUTPUT
- name: Cache prerequisites
if: matrix.compiler == 'gcc'
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
key: prereqs-mingw-${{ hashFiles('ci/setup-prerequisites-mingw.ps1') }}
- name: libdwarf
run: |
if("${{matrix.compiler}}" -eq "gcc") {
cd ..
cpptrace/ci/setup-prerequisites-mingw.ps1
}
- name: build
run: |
python3 ci/build-in-all-remaining-configs.py --${{matrix.compiler}}
performancetest-linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [g++-11, clang++-14]
config: [
-DSPEEDTEST_DWARF4=On,
-DSPEEDTEST_DWARF5=On
]
needs: test-linux-all-configurations
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-11 g++-11 libgcc-11-dev ninja-build ccache
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-perftest-linux-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-perftest-linux-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build
run: |
mkdir -p build
cd build
cmake .. -GNinja -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=foo
ninja
ninja install
mkdir -p ../test/speedtest/build
cd ../test/speedtest/build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
${{matrix.config}}
ninja
- name: speedtest
working-directory: test/speedtest/build
run: |
./speedtest | python3 ../../../ci/speedtest.py ${{matrix.compiler}} ${{matrix.config}}
test-linux-integration:
runs-on: ubuntu-22.04
needs: test-linux-all-configurations
steps:
- uses: actions/checkout@v4
- name: Install ccache
run: |
sudo apt-get update
sudo apt install ccache
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-integration-linux-${{ runner.arch }}-${{ github.sha }}
restore-keys: |
ccache-integration-linux-${{ runner.arch }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: Integration tests
run: bash ci/integration-test.sh "$HOME/cpptrace-install" --ccache
- name: ccache stats
run: ccache -s
test-macos-integration:
runs-on: macos-14
needs: test-macos-all-configurations
steps:
- uses: actions/checkout@v4
- name: Install ccache
run: brew install ccache
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-integration-macos-${{ github.sha }}
restore-keys: |
ccache-integration-macos-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: Integration tests
run: bash ci/integration-test.sh "$HOME/cpptrace-install" --ccache
- name: ccache stats
run: ccache -s
test-mingw-integration:
runs-on: windows-2022
needs: test-windows-all-configurations
steps:
- uses: actions/checkout@v4
- name: Install ccache
run: choco install ccache --no-progress -y
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~\AppData\Local\ccache
key: ccache-integration-mingw-${{ github.sha }}
restore-keys: |
ccache-integration-mingw-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(Split-Path $env:GITHUB_WORKSPACE)"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: Integration tests
run: ci/integration-test-windows.ps1 -InstallPrefix C:/foo -Ccache
- name: ccache stats
run: ccache -s
test-windows-integration:
runs-on: windows-2022
needs: test-windows-all-configurations
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Install ccache
run: choco install ccache --no-progress -y
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~\AppData\Local\ccache
key: ccache-integration-msvc-${{ github.sha }}
restore-keys: |
ccache-integration-msvc-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(Split-Path $env:GITHUB_WORKSPACE)"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: Integration tests
run: ci/integration-test-windows.ps1 -InstallPrefix C:/foo -Ccache
- name: ccache stats
run: ccache -s
unittest-linux:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler: [g++-10, clang++-18]
stdlib: [libstdc++, libc++]
dwarf_version: [4, 5]
split_dwarf: [OFF, ON]
exclude:
- compiler: g++-10
stdlib: libc++
steps:
- uses: actions/checkout@v4
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
${{ steps.prereqs-path.outputs.dir }}/googletest
/tmp/gtest_install
/tmp/gtest_install_libcxx
key: prereqs-unittest-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites-unittest.sh') }}
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-10 g++-10 libgcc-10-dev ninja-build libc++-dev ninja-build ccache
cd ..
cpptrace/ci/setup-prerequisites-unittest.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-unittest-linux-x64-${{ matrix.compiler }}-${{ matrix.stdlib }}-${{ github.sha }}
restore-keys: |
ccache-unittest-linux-x64-${{ matrix.compiler }}-${{ matrix.stdlib }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=600M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
python3 ci/unittest.py \
--slice=compiler:${{matrix.compiler}} \
--slice=stdlib:${{matrix.stdlib}} \
--slice=dwarf_version:${{matrix.dwarf_version}} \
--slice=split_dwarf:${{matrix.split_dwarf}}
unittest-linux-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install -y libtool libncurses5
- name: test dbg
run: |
bazel test //... -c dbg
- name: test opt
run: |
bazel test //... -c opt
unittest-linux-arm:
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
compiler: [g++-10, clang++-18]
stdlib: [libstdc++, libc++]
dwarf_version: [4, 5]
split_dwarf: [OFF, ON]
exclude:
- compiler: g++-10
stdlib: libc++
steps:
- uses: actions/checkout@v4
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
${{ steps.prereqs-path.outputs.dir }}/googletest
/tmp/gtest_install
/tmp/gtest_install_libcxx
key: prereqs-unittest-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('ci/setup-prerequisites-unittest.sh') }}
- name: dependencies
run: |
sudo apt-get update
sudo apt install gcc-10 g++-10 libgcc-10-dev ninja-build libc++-dev ninja-build ccache
cd ..
cpptrace/ci/setup-prerequisites-unittest.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-unittest-linux-arm-${{ matrix.compiler }}-${{ matrix.stdlib }}-${{ github.sha }}
restore-keys: |
ccache-unittest-linux-arm-${{ matrix.compiler }}-${{ matrix.stdlib }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=600M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
python3 ci/unittest.py \
--slice=compiler:${{matrix.compiler}} \
--slice=stdlib:${{matrix.stdlib}} \
--slice=dwarf_version:${{matrix.dwarf_version}} \
--slice=split_dwarf:${{matrix.split_dwarf}}
unittest-macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.4"
- name: Resolve prereqs path
id: prereqs-path
run: echo "dir=$(cd .. && pwd)" >> "$GITHUB_OUTPUT"
- name: Cache prerequisites
uses: actions/cache@v4
with:
path: |
${{ steps.prereqs-path.outputs.dir }}/zstd
${{ steps.prereqs-path.outputs.dir }}/libdwarf
${{ steps.prereqs-path.outputs.dir }}/googletest
/tmp/gtest_install
/tmp/gtest_asan_install
/tmp/gtest_install_gcc
key: prereqs-unittest-macos-${{ hashFiles('ci/setup-prerequisites-unittest-macos.sh') }}
- name: dependencies
run: |
brew install gcc@12 ninja ccache
python3 -m venv env
env/bin/pip install colorama
cd ..
cpptrace/ci/setup-prerequisites-unittest-macos.sh
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-unittest-macos-${{ github.sha }}
restore-keys: |
ccache-unittest-macos-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
env/bin/python ci/unittest.py
unittest-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler: [cl, clang++]
shared: [OFF] # TODO: Re-enable shared
build_type: [Debug, RelWithDebInfo]
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: build and test
run: |
mkdir build
cd build
cmake .. `
-DCMAKE_CXX_COMPILER=${{matrix.compiler}} `
-DCMAKE_C_COMPILER=${{matrix.compiler == 'clang++' && 'clang' || matrix.compiler}} `
-DBUILD_SHARED_LIBS=${{matrix.shared}} `
-DCPPTRACE_WERROR_BUILD=On `
-DCPPTRACE_BUILD_TESTING=On
cmake --build . --config ${{matrix.build_type}}
./${{matrix.build_type}}/unittest
# TODO: Macos, mingw
unittest-linux-modules:
runs-on: ubuntu-24.04
needs: unittest-linux
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get update
sudo apt install ninja-build clang-19 clang-tools-19 ccache
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-unittest-linux-modules-${{ github.sha }}
restore-keys: |
ccache-unittest-linux-modules-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=clang++-19 \
-DCMAKE_C_COMPILER=clang-19 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_STANDARD=20 \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off \
-DCPPTRACE_BUILD_TESTING=On
ninja
./unittest_module
unittest-linux-32-bit:
runs-on: ubuntu-24.04
needs: unittest-linux
strategy:
fail-fast: false
matrix:
compiler: [g++-10, clang++-18]
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt update
sudo apt install gcc-10 g++-10 libgcc-10-dev clang-19 clang-tools-19 ninja-build gcc-multilib g++-multilib g++-10-multilib ccache
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-unittest-linux-32bit-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
ccache-unittest-linux-32bit-${{ matrix.compiler }}-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=${{matrix.compiler}} \
-DCMAKE_C_COMPILER=${{matrix.compiler == 'clang++-18' && 'clang' || 'gcc'}} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off \
-DCPPTRACE_BUILD_TESTING=On \
-DCMAKE_C_FLAGS=-m32 \
-DCMAKE_CXX_FLAGS=-m32
ninja
./unittest
unittest-linux-gcc-4-8-5:
runs-on: ubuntu-24.04
needs: unittest-linux
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt update
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/g++-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/libstdc++-4.8-dev_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8-base_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/libgcc-4.8-dev_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/cpp-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-4.8/libasan0_4.8.5-4ubuntu8_amd64.deb
sudo apt install ./gcc-4.8_4.8.5-4ubuntu8_amd64.deb ./gcc-4.8-base_4.8.5-4ubuntu8_amd64.deb ./libstdc++-4.8-dev_4.8.5-4ubuntu8_amd64.deb ./cpp-4.8_4.8.5-4ubuntu8_amd64.deb ./libgcc-4.8-dev_4.8.5-4ubuntu8_amd64.deb ./libasan0_4.8.5-4ubuntu8_amd64.deb ./g++-4.8_4.8.5-4ubuntu8_amd64.deb
sudo apt install ccache
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-unittest-linux-gcc48-${{ github.sha }}
restore-keys: |
ccache-unittest-linux-gcc48-
- name: Configure ccache
run: |
ccache --set-config=max_size=300M
ccache --set-config=compression=true
ccache --set-config=hash_dir=false
ccache --set-config=base_dir="$(dirname "$GITHUB_WORKSPACE")"
ccache --set-config=sloppiness=locale,time_macros
ccache -z
- name: build and test
run: |
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=g++-4.8 \
-DCMAKE_C_COMPILER=gcc-4.8 \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off
ninja
unittest-freebsd:
runs-on: ubuntu-24.04
needs: unittest-linux
steps:
- uses: actions/checkout@v4
- name: build and test
id: test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
run: |
pkg install -y cmake lang/gcc ninja git
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off \
-DCPPTRACE_BUILD_TESTING=On
ninja
./unittest
unittest-netbsd:
runs-on: ubuntu-24.04
needs: unittest-linux
steps:
- uses: actions/checkout@v4
- name: build and test
id: test
uses: vmactions/netbsd-vm@v1
with:
usesh: true
run: |
pkg_add -u pcre2
pkg_add cmake ninja-build git
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off \
-DCPPTRACE_BUILD_TESTING=On
ninja
paxctl +m ./unittest
./unittest
unittest-openbsd:
runs-on: ubuntu-24.04
needs: unittest-linux
steps:
- uses: actions/checkout@v4
- name: build and test
id: test
uses: vmactions/openbsd-vm@v1
with:
usesh: true
run: |
pkg_add cmake ninja git
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off \
-DCPPTRACE_BUILD_TESTING=On \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,norelro"
ninja
./unittest
unittest-cygwin:
runs-on: windows-2022
needs: unittest-linux
steps:
- uses: actions/checkout@v4
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v4
with:
packages: cmake gcc-g++ ninja git
- name: build and test
shell: C:\cygwin\bin\bash.exe --login -o igncr {0}
run: |
cd "$GITHUB_WORKSPACE"
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCPPTRACE_WERROR_BUILD=On \
-DCPPTRACE_STD_FORMAT=Off \
-DCPPTRACE_BUILD_TESTING=On
ninja
./unittest.exe
unittest-windows-32-bit:
runs-on: windows-2022
needs: unittest-windows
strategy:
fail-fast: false
matrix:
build_type: [Debug]
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: build and test
run: |
mkdir build
cd build
cmake .. `
-A Win32 `
-DCPPTRACE_WERROR_BUILD=On `
-DCPPTRACE_BUILD_TESTING=On
cmake --build . --config ${{matrix.build_type}}
./${{matrix.build_type}}/unittest
unittest-windows-clangcl:
runs-on: windows-2022
needs: unittest-windows
strategy:
fail-fast: false
matrix:
build_type: [Debug]
arch: [x64, Win32]
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: build and test
run: |
mkdir build
cd build
cmake .. `
-T ClangCL `
-A ${{matrix.arch}} `
-DCPPTRACE_WERROR_BUILD=On `
-DCPPTRACE_BUILD_TESTING=On
cmake --build . --config ${{matrix.build_type}}
./${{matrix.build_type}}/unittest