C/C++ CI #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C/C++ CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 4 * * 5' # Every Friday at 4am | |
# Drop permissions to minimum for security | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libgcrypt-dev" | |
} | |
- { | |
name: "Ubuntu_CLANG", | |
os: ubuntu-22.04, | |
cc: "clang", | |
cxx: "clang++", | |
crypto: "libgcrypt-dev", | |
configure_args: "--enable-asan" | |
} | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libgcrypt-dev", | |
configure_args: "--without-ldap" | |
} | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libgcrypt-dev", | |
configure_args: "--enable-debug-build" | |
} | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libgcrypt-dev", | |
configure_args: "--enable-asan" | |
} | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libgcrypt-dev", | |
configure_args: "--with-crypto-library=gcrypt" | |
} | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libsodium-dev", | |
configure_args: "--with-crypto-library=sodium" | |
} | |
- { | |
name: "Ubuntu_GCC", | |
os: ubuntu-22.04, | |
cc: "gcc", | |
cxx: "g++", | |
crypto: "libssl-dev", | |
configure_args: "--with-crypto-library=openssl" | |
} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: installing dependencies | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get install -y ansible | |
sudo apt-get install -y libudev-dev libsodium-dev libqb-dev libcap-ng-dev libseccomp-dev | |
sudo apt-get install -y libglib2.0-dev libdbus-glib-1-dev libxml2-utils libpolkit-gobject-1-dev xsltproc | |
sudo apt-get install -y lcov | |
sudo apt-get install -y aspell aspell-en | |
sudo apt-get install -y libprotobuf-dev protobuf-compiler | |
sudo apt-get install -y libldap-dev | |
sudo apt-get install -y valgrind | |
sudo apt-get install -y asciidoc docbook-xml docbook-xsl | |
sudo apt-get install -y umockdev libumockdev-dev | |
sudo gem install coveralls-lcov | |
sudo apt-get install -y ${{ matrix.config.cc }} | |
sudo apt-get install -y ${{ matrix.config.cxx }} || true | |
sudo apt-get install -y ${{ matrix.config.crypto }} | |
sudo apt-get install -y astyle | |
- name: setup environment | |
run: | | |
cd src/Tests/LDAP/ansible | |
ansible-playbook -i ./hosts -u root --connection=local playbook.yml | |
- name: build | |
run: | | |
./autogen.sh | |
mkdir build && cd build | |
${{ matrix.config.cc }} --version | |
${{ matrix.config.cxx }} --version | |
CC=${{ matrix.config.cc }} CXX=${{ matrix.config.cxx }} ../configure --enable-werror --disable-silent-rules --with-bundled-catch --with-bundled-pegtl --with-ldap --enable-full-test-suite ${{ matrix.config.configure_args }} | |
make "-j$(nproc)" | |
- name: install (off-system, for coverage) | |
run: |- | |
set -x -o pipefail | |
make -C build DESTDIR="${PWD}"/ROOT install | |
find ROOT/ -not -type d | sort | xargs ls -l | |
rm -Rf find ROOT/ # to not interfere with check-driver.sh | |
- name: check | |
run: sudo make -C build check -j1 || { find -name test-suite.log -print -exec cat {} \; ; false ; } | |
- name: distcheck | |
run: sudo make -C build distcheck -j1 || { find -name test-suite.log -print -exec cat {} \; ; false ; } |