Skip to content

Commit

Permalink
Revamp and modernize the CI scripts
Browse files Browse the repository at this point in the history
This is partially copied from the pkcs11-provider CI scripts which
instantiate conatiners to bring in more reasonable distro defaults and
properly check on multiple compilers

Signed-off-by: Simo Sorce <[email protected]>
  • Loading branch information
simo5 committed Feb 11, 2025
1 parent b8e6051 commit a184785
Showing 1 changed file with 54 additions and 31 deletions.
85 changes: 54 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,57 @@ name: CI
on: [push, pull_request]

jobs:
ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name: [ubuntu-clang, ubuntu-gcc]
include:
- name: ubuntu-clang
compiler: clang
cflags: -Wall -Wextra -Werror -Wno-cast-align -Wno-unused-parameter -Wno-missing-braces
- name: ubuntu-gcc
compiler: gcc
cflags: -Wall -Wextra -Werror -Wno-unused-parameter -Wno-format-truncation -Wno-restrict
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential autopoint clang gcc docbook-{xsl,xml} libxml2-utils xml-core xsltproc lib{krb5,ini-config,keyutils,popt,selinux1,systemd,verto}-dev lib{nss,socket}-wrapper python3{,-colorama} valgrind krb5-{kdc,admin-server,kdc-ldap} ldap-utils slapd apparmor-utils
- name: Silence AppArmor
run: sudo aa-complain $(which slapd)
- name: Setup
run: |
autoreconf -fiv
./configure
- name: Build and test
env:
CFLAGS: ${{ matrix.cflags }}
CC: ${{ matrix.compiler }}
run: make -s distcheck DISTCHECK_CONFIGURE_FLAGS="CFLAGS=\"$CFLAGS\" CC=\"$CC\""
ci:
name: CI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name: [fedora, debian]
compiler: [gcc, clang]
include:
- name: fedora
container: fedora:latest
- name: debian
container: debian:sid
container: ${{ matrix.container }}
steps:
- name: Install dependencies
run: |
if [ -f /etc/redhat-release ]; then
dnf -y install --setopt='tsflags=' ${{ matrix.compiler }} \
make autoconf automake libtool pkgconf-pkg-config \
gettext-devel openssl-devel popt-devel docbook-style-xsl \
xml-common libxslt krb5-workstation krb5-devel \
libini_config-devel nss_wrapper socket_wrapper systemd-devel \
libselinux-devel libverto-devel python3 python3-colorama \
krb5-server krb5-server-ldap openldap-servers openldap-clients \
which valgrind
elif [ -f /etc/debian_version ]; then
apt-get -q update
apt-get -yq install ${{ matrix.compiler }} make autoconf \
automake autotools-dev libtool pkg-config autopoint libssl-dev \
docbook-xsl docbook-xml libxml2-utils xml-core xsltproc \
libkrb5-dev libini-config-dev libkeyutils-dev libpopt-dev \
libselinux1-dev libsystemd-dev systemd-dev libverto-dev \
libnss-wrapper libsocket-wrapper python3 python3-colorama \
krb5-kdc krb5-admin-server krb5-kdc-ldap ldap-utils slapd \
valgrind
fi
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup
run: |
autoreconf -fiv
./configure
- name: Build and test
env:
CC: ${{ matrix.compiler }}
run: make -s distcheck DISTCHECK_CONFIGURE_FLAGS="CC=\"$CC\""
- uses: actions/upload-artifact@v4
if: failure()
with:
name: logs ${{ matrix.name }}, ${{ matrix.compiler }}
path: |
config.log
testdir

0 comments on commit a184785

Please sign in to comment.