Skip to content

Commit 4348686

Browse files
committed
Revamp and modernize the CI scripts
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]>
1 parent b8e6051 commit 4348686

File tree

1 file changed

+53
-31
lines changed

1 file changed

+53
-31
lines changed

.github/workflows/ci.yaml

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,56 @@ name: CI
22
on: [push, pull_request]
33

44
jobs:
5-
ubuntu:
6-
runs-on: ubuntu-latest
7-
strategy:
8-
fail-fast: false
9-
matrix:
10-
name: [ubuntu-clang, ubuntu-gcc]
11-
include:
12-
- name: ubuntu-clang
13-
compiler: clang
14-
cflags: -Wall -Wextra -Werror -Wno-cast-align -Wno-unused-parameter -Wno-missing-braces
15-
- name: ubuntu-gcc
16-
compiler: gcc
17-
cflags: -Wall -Wextra -Werror -Wno-unused-parameter -Wno-format-truncation -Wno-restrict
18-
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v2
21-
- name: Install dependencies
22-
run: |
23-
sudo apt-get update
24-
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
25-
- name: Silence AppArmor
26-
run: sudo aa-complain $(which slapd)
27-
- name: Setup
28-
run: |
29-
autoreconf -fiv
30-
./configure
31-
- name: Build and test
32-
env:
33-
CFLAGS: ${{ matrix.cflags }}
34-
CC: ${{ matrix.compiler }}
35-
run: make -s distcheck DISTCHECK_CONFIGURE_FLAGS="CFLAGS=\"$CFLAGS\" CC=\"$CC\""
5+
ci:
6+
name: CI
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
name: [fedora, debian]
12+
compiler: [gcc, clang]
13+
include:
14+
- name: fedora
15+
container: fedora:latest
16+
- name: debian
17+
container: debian:sid
18+
container: ${{ matrix.container }}
19+
steps:
20+
- name: Install dependencies
21+
run: |
22+
if [ -f /etc/redhat-release ]; then
23+
dnf -y install ${{ matrix.compiler }} make autoconf automake \
24+
libtool pkgconf-pkg-config gettext-devel openssl-devel \
25+
popt-devel docbook-style-xsl libxml2 xml-common libxslt \
26+
krb5-workstation krb5-devel libini_config-devel nss_wrapper \
27+
socket_wrapper systemd-devel libselinux-devel libverto-devel \
28+
python3 python3-colorama which krb5-server krb5-server-ldap \
29+
openldap-servers openldap-clients valgrind
30+
elif [ -f /etc/debian_version ]; then
31+
apt-get -q update
32+
apt-get -yq install ${{ matrix.compiler }} autoconf automake \
33+
autotools-dev libtool pkg-config autopoint libssl-dev \
34+
docbook-xsl docbook-xml libxml2-utils xml-core xsltproc \
35+
libkrb5-dev libini-config-dev libkeyutils-dev libpopt-dev \
36+
libselinux1-dev libsystemd-dev systemd-dev libverto-dev \
37+
libnss-wrapper libsocket-wrapper python3 python3-colorama \
38+
krb5-kdc krb5-admin-server krb5-kdc-ldap ldap-utils slapd \
39+
valgrind
40+
fi
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
- name: Setup
44+
run: |
45+
autoreconf -fiv
46+
./configure
47+
- name: Build and test
48+
env:
49+
CC: ${{ matrix.compiler }}
50+
run: make -s distcheck DISTCHECK_CONFIGURE_FLAGS="CC=\"$CC\""
51+
- uses: actions/upload-artifact@v4
52+
if: failure()
53+
with:
54+
name: logs ${{ matrix.name }}, ${{ matrix.compiler }}
55+
path: |
56+
config.log
57+
testdir

0 commit comments

Comments
 (0)