-
Notifications
You must be signed in to change notification settings - Fork 119
70 lines (70 loc) · 2.44 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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: ""
- os: ubuntu-20.04
config_args: ""
extra: "libldap2-dev libykpers-1-dev libnet-ldap-server-perl libmysqlclient-dev"
mysql: true
- os: ubuntu-18.04
config_args: ""
extra: "libldap2-dev libykpers-1-dev libnet-ldap-server-perl libmysqlclient-dev"
mysql: true
- 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
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
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