Skip to content
This repository was archived by the owner on Sep 27, 2026. It is now read-only.

Merge pull request #36 from cpptest/pull-32-subset #146

Merge pull request #36 from cpptest/pull-32-subset

Merge pull request #36 from cpptest/pull-32-subset #146

Workflow file for this run

# Copyright (c) 2024 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GNU LGPL v2.1 or later
name: Build on Linux
on:
pull_request:
push:
schedule:
- cron: '0 3 * * 5' # Every Friday at 3am
workflow_dispatch:
# Minimum permissions for security
permissions:
contents: read
jobs:
linux:
name: Build (${{ matrix.cxx }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- cc: gcc-14
cxx: g++-14
clang_major_version: null
upload: true
- cc: clang-20
cxx: clang++-20
clang_major_version: 20
steps:
- name: Checkout Git branch
uses: actions/checkout@v7
- name: Install build dependencies
run: |-
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
abi-compliance-checker \
doxygen \
lzip
- name: Install build dependency Clang ${{ matrix.clang_major_version }}
if: "${{ contains(matrix.cxx, 'clang') }}"
run: |-
sudo apt-get install --yes --no-install-recommends -V \
clang-${{ matrix.clang_major_version }} \
libclang-rt-${{ matrix.clang_major_version }}-dev
- name: 'autoreconf'
run: |-
set -x
./autogen.sh
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
# https://github.com/actions/runner-images/issues/9524#issuecomment-2002475952
run: |-
sudo sysctl vm.mmap_rnd_bits=28
- name: './configure'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CXXFLAGS: -std=c++11 -Wall -Wextra -pedantic -Werror -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common
LDFLAGS: -Wl,--as-needed -g -fsanitize=address,undefined
run: |-
set -x
mkdir build
cd build
../configure --enable-doc
- name: 'make all'
run: |-
set -x
make -C build -j$(nproc) all
# and a smoke test ..
cd build
./test/mytest # i.e. ensure that the example exits with code 0
./test/mytest --compiler
./test/mytest --html
./test/mytest --text-terse
./test/mytest --text-verbose
- name: 'make distcheck'
run: |-
set -x
make -C build distcheck # without sanitizers
ls -lh build/cpptest-*.tar.*
- name: 'Upload "make dist" artifacts'
if: "${{ matrix.upload }}"
uses: actions/upload-artifact@v7
with:
name: cpptest-${{ github.sha }}-release-tarball
path: build/cpptest-*.tar.bz2
if-no-files-found: error
- name: 'make install'
run: |-
set -x -o pipefail
make -C build install DESTDIR="${PWD}"/ROOT/
find ROOT/ | sort | xargs ls -ld
- name: 'make uninstall'
run: |-
set -x
make -C build uninstall DESTDIR="${PWD}"/ROOT/
[[ "$(find ROOT/ -not -type d | tee /dev/stderr)" == '' ]] # i.e. fail CI if leftover files
- name: './check-abi.sh'
run: |-
set -x
# Make "git describe --tags" work (even for forks)
git remote get-url origin | grep -q https://github.com/cpptest/cpptest \
|| git remote set-url origin https://github.com/cpptest/cpptest
git fetch --force --tags --unshallow origin
./check-abi.sh