Skip to content

Commit 98fb40c

Browse files
frozencemeterysimo5
authored andcommitted
[CI] Migrate to GitHub Actions
Drop centos builder since el7 isn't being updated and el8 is missing dependencies. Move flake onto fedora-gcc. Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1 parent e60384c commit 98fb40c

File tree

4 files changed

+83
-46
lines changed

4 files changed

+83
-46
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "CI",
3+
"on": {
4+
"pull_request": null,
5+
"push": {
6+
"branches-ignore": "master",
7+
"tags-ignore": "*",
8+
},
9+
},
10+
"jobs": {
11+
"linux": {
12+
"runs-on": "ubuntu-latest",
13+
"strategy": {
14+
"fail-fast": false,
15+
"matrix": {
16+
"name": ["fedora-gcc", "fedora-clang", "debian-clang"],
17+
"include": [
18+
{
19+
"name": "fedora-gcc",
20+
"distro": "fedora:latest",
21+
"compiler": "gcc",
22+
"flake": "yes",
23+
},
24+
{
25+
"name": "fedora-clang",
26+
"distro": "fedora:latest",
27+
"compiler": "clang",
28+
},
29+
{
30+
"name": "debian-clang",
31+
"distro": "debian:sid",
32+
"compiler": "clang",
33+
},
34+
],
35+
},
36+
},
37+
"steps": [
38+
{
39+
"name": "Check out code",
40+
"uses": "actions/checkout@v2",
41+
},
42+
{
43+
"name": "Build and test",
44+
"run": "./ci/run_dockerized.sh",
45+
"env": {
46+
"DISTRO": "${{ matrix.distro }}",
47+
"COMPILER": "${{ matrix.compiler }}",
48+
"FLAKE": "${{ matrix.flake }}",
49+
},
50+
},
51+
],
52+
},
53+
},
54+
}

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.travis.sh renamed to ci/ci.sh

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
11
#!/bin/bash -ex
22

33
if [ -f /etc/debian_version ]; then
4-
PYTHON=python3
54
export DEBIAN_FRONTEND=noninteractive
65

7-
apt-get update
6+
apt-get -q update
87

9-
apt-get -y install $COMPILER pkg-config flake8 virtualenv \
8+
apt-get -yq install $COMPILER pkg-config flake8 virtualenv \
109
apache2-bin {apache2,libkrb5,libssl,gss-ntlmssp}-dev \
11-
$PYTHON{,-dev,-requests} lib{socket,nss}-wrapper \
12-
flex bison krb5-{kdc,admin-server,pkinit} curl
10+
python3{,-dev,-requests} lib{socket,nss}-wrapper \
11+
flex bison krb5-{kdc,admin-server,pkinit} curl libfaketime
1312

14-
apt-get -y install $PYTHON-requests-gssapi 2>/dev/null || true
15-
16-
flake8
17-
elif [ -f /etc/redhat-release ]; then
18-
DY=yum
19-
PYTHON=python2
20-
if [ -f /etc/fedora-release ]; then
21-
DY=dnf
22-
PYTHON=python3
23-
fi
24-
25-
$DY -y install $COMPILER $PYTHON-{gssapi,requests} \
26-
krb5-{server,workstation,pkinit} curl \
13+
apt-get -yq install python3-requests-gssapi 2>/dev/null || true
14+
elif [ -f /etc/fedora-release ]; then
15+
dnf -y install $COMPILER python3-{gssapi,requests{,-gssapi},flake8} \
16+
krb5-{server,workstation,pkinit} curl libfaketime \
2717
{httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \
28-
autoconf automake libtool which bison make $PYTHON \
18+
autoconf automake libtool which bison make python3 \
2919
flex mod_session redhat-rpm-config /usr/bin/virtualenv
30-
31-
$DY -y install python-requests-gssapi 2>/dev/null || true
3220
else
3321
echo "Distro not found!"
3422
false
3523
fi
3624

25+
if [ x$FLAKE == xyes ]; then
26+
flake8
27+
fi
28+
3729
CFLAGS="-Werror"
3830
if [ x$COMPILER == xclang ]; then
3931
CFLAGS+=" -Wno-missing-field-initializers"
@@ -45,7 +37,7 @@ if [ x$COMPILER == xclang ]; then
4537
cp=$(which clang)
4638
mv $cp $cp.real
4739
cat > $cp <<EOF
48-
#!/usr/bin/env python
40+
#!/usr/bin/env python3
4941
import os
5042
import sys
5143
argv = [a for a in sys.argv if a != "-fstack-clash-protection" \
@@ -56,12 +48,14 @@ EOF
5648
chmod +x $cp
5749
fi
5850

59-
virtualenv --system-site-packages -p $(which $PYTHON) .venv
51+
virtualenv --system-site-packages -p $(which python3) .venv
6052
source .venv/bin/activate
6153
pip install requests{,-gssapi}
6254

6355
scratch=/tmp/build/mod_auth_gssapi-*/_build/sub/testsdir
6456

6557
autoreconf -fiv
6658
./configure # overridden by below, but needs to generate Makefile
67-
make distcheck DISTCHECK_CONFIGURE_FLAGS="CFLAGS=\"$CFLAGS\" CC=$(which $COMPILER)" || (cat $scratch/tests.log $scratch/httpd/logs/error_log; exit -1)
59+
DCF="CFLAGS=\"$CFLAGS\" CC=$(which $COMPILER)"
60+
make distcheck DISTCHECK_CONFIGURE_FLAGS="$DCF" ||
61+
(cat $scratch/tests.log $scratch/httpd/logs/error_log; exit -1)

ci/run_dockerized.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -ex
2+
3+
COMPILER=${COMPILER:-gcc}
4+
FLAKE=${FLAKE:-no}
5+
6+
docker run \
7+
-v $(pwd):/tmp/build \
8+
-w /tmp/build \
9+
-e COMPILER=$COMPILER \
10+
-e FLAKE=$FLAKE \
11+
$DISTRO /bin/bash -ex ./ci/ci.sh

0 commit comments

Comments
 (0)