1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-01-31 16:52:19 +01:00
yubico-pam/.github/workflows/build_and_test.yml

71 lines
2.4 KiB
YAML
Raw Normal View History

name: Build and Test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
config_args: "--without-mysql"
extra: "libldap2-dev libykpers-1-dev libnet-ldap-server-perl"
- os: ubuntu-20.04
config_args: "--without-ldap --without-mysql"
extra: "libykpers-1-dev"
- os: ubuntu-20.04
config_args: "--without-cr --without-mysql"
extra: "libldap2-dev libnet-ldap-server-perl"
- os: ubuntu-20.04
config_args: "--without-ldap --without-cr --without-mysql"
extra: ""
2021-03-31 11:48:26 +02:00
- os: ubuntu-20.04
config_args: ""
extra: "libldap2-dev libykpers-1-dev libnet-ldap-server-perl libmysqlclient-dev"
mysql: true
2021-03-31 12:54:56 +02:00
- os: ubuntu-18.04
config_args: ""
extra: "libldap2-dev libykpers-1-dev libnet-ldap-server-perl libmysqlclient-dev"
mysql: true
2021-03-31 12:54:56 +02:00
- os: ubuntu-16.04
config_args: ""
extra: "libldap2-dev libykpers-1-dev libnet-ldap-server-perl libmysqlclient-dev"
mysql: true
services:
mariadb:
image: mariadb:latest
ports:
- 3306
env:
MYSQL_USER: user
MYSQL_PASSWORD: password
2021-04-06 13:36:00 +02:00
MYSQL_DATABASE: otp
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v1
- name: Setup Database
if: ${{ matrix.mysql }}
env:
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$MYSQL_PORT" --silent; do
sleep 1
done
2021-04-06 13:36:00 +02:00
mysql --user=user --password=password --host=127.0.0.1 --port=$MYSQL_PORT otp < yubikey_mapping.sql
mysql --user=user --password=password --host=127.0.0.1 --port=$MYSQL_PORT otp < tests/aux/auth_mapping.sql
- name: Build and test
env:
CONFIGURE_ARGS: ${{ matrix.config_args }}
EXTRA: ${{ matrix.extra }}
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
tests/aux/build-and-test.sh
- name: Display logs
if: ${{ always() }}
run: |
for log in tests/*.log; do
echo $log
cat $log
done