--- /dev/null
+name: build
+
+on:
+ push:
+ branches-ignore:
+ - "debian/**"
+ - "pristine-tar"
+ - "ubuntu/**"
+ - "upstream/**"
+ tags:
+ - "release/*"
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ env:
+ AUTHOR_TESTING: 1
+ C_TAP_VERBOSE: 1
+
+ strategy:
+ fail-fast: false
+ matrix:
+ compiler:
+ - "gcc"
+ - "clang"
+ kerberos:
+ - "mit"
+ - "heimdal"
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: install
+ run: sudo ci/install
+ - name: test
+ run: ci/test
+ env:
+ COMPILER: ${{ matrix.compiler }}
+ KERBEROS: ${{ matrix.kerberos }}
+++ /dev/null
-language: c
-compiler:
- - gcc
-dist: trusty
-sudo: required
-
-before_install:
- - sudo apt-get update -qq
- - sudo apt-get install libcdb-dev libdb-file-lock-perl libcrypt-pbkdf2-perl libdbd-sqlite3-perl libdbi-perl libgetopt-long-descriptive-perl libipc-run-perl libjson-perl libkrb5-dev libperl6-slurp-perl libreadonly-perl libsqlite3-dev libtest-minimumversion-perl libtest-perl-critic-perl libtest-pod-perl libtest-strict-perl pkg-config sqlite tinycdb
-env: AUTHOR_TESTING=1
-script: ./bootstrap && ./configure && make warnings && make check
-
-branches:
- only:
- - master
# See LICENSE for licensing terms.
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = .clang-format .gitignore .travis.yml README.md LICENSE \
- bootstrap cracklib/HISTORY cracklib/LICENCE cracklib/README \
- cracklib/genrules.pl cracklib/mkdict docs/krb5-strength.5.in \
- docs/krb5-strength.pod docs/metadata tests/README tests/TESTS \
- tests/data/krb5.conf tests/data/make-krb5-conf tests/data/passwords \
- tests/data/perl.conf tests/data/perlcriticrc tests/data/perltidyrc \
+EXTRA_DIST = .clang-format .github .gitignore README.md LICENSE bootstrap \
+ ci/README ci/install ci/test cracklib/HISTORY cracklib/LICENCE \
+ cracklib/README cracklib/genrules.pl cracklib/mkdict \
+ docs/krb5-strength.5.in docs/krb5-strength.pod docs/metadata \
+ tests/README tests/TESTS tests/data/krb5.conf \
+ tests/data/make-krb5-conf tests/data/passwords tests/data/perl.conf \
+ tests/data/perlcriticrc tests/data/perltidyrc \
tests/data/valgrind.supp tests/data/wordlist \
tests/data/wordlist.cdb tests/data/wordlist.sqlite \
tests/docs/pod-spelling-t tests/docs/pod-t tests/perl/critic-t \
--- /dev/null
+The files in this directory are used for CI testing. ci/install installs
+the prerequisite packages, and ci/test runs the tests.
--- /dev/null
+#!/bin/sh
+#
+# Install packages for integration tests.
+#
+# This script is normally run via sudo in a test container or VM, such as via
+# GitHub Actions.
+#
+# Perl::Tidy, Perl::Critic, and Test::Perl::Critic are installed separately to
+# get the latest version, since they sometimes change formatting and style
+# rules compared to the version in Ubuntu. Test::MinimumVersion has to be
+# included since it installs Perl::Critic.
+#
+# Allow the installation of Perl::Critic and Test::Perl::Critic to fail, since
+# sometimes the versions on CPAN won't install. (We'll just skip the test if
+# it won't install.)
+#
+# Copyright 2015-2020 Russ Allbery <eagle@eyrie.org>
+#
+# SPDX-License-Identifier: MIT
+
+set -eux
+
+# Install packages.
+apt-get update -qq
+apt-get install aspell cpanminus cppcheck heimdal-multidev libcdb-dev \
+ libdb-file-lock-perl libcrypt-pbkdf2-perl libdbd-sqlite3-perl \
+ libdbi-perl libgetopt-long-descriptive-perl libipc-run-perl \
+ libjson-perl libkrb5-dev libperl6-slurp-perl libreadonly-perl \
+ libsqlite3-dev libtest-minimumversion-perl libtest-pod-perl \
+ libtest-spelling-perl libtest-strict-perl pkg-config perl sqlite \
+ tinycdb valgrind
+
+# Dependencies for Perl tests.
+cpanm Perl::Tidy
+cpanm Perl::Critic || true
+cpanm Test::MinimumVersion || true
+cpanm Test::Perl::Critic || true
--- /dev/null
+#!/bin/sh
+#
+# Run tests for continuous integration.
+#
+# This script is normally run in a test container or VM, such as via GitHub
+# Actions.
+#
+# Copyright 2015-2020 Russ Allbery <eagle@eyrie.org>
+#
+# SPDX-License-Identifier: MIT
+
+set -eux
+
+# Normally, COMPILER and KERBEROS are set based on the CI matrix, but provide
+# a default in case someone runs this test by hand.
+COMPILER="${COMPILER:-gcc}"
+KERBEROS="${KERBEROS:-mit}"
+
+# Build everything.
+./bootstrap
+if [ "$KERBEROS" = 'heimdal' ]; then
+ ./configure CC="$COMPILER" PATH_KRB5_CONFIG=/usr/bin/krb5-config.heimdal
+else
+ ./configure CC="$COMPILER"
+fi
+make warnings
+
+# Run tests.
+make check