diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2021-05-26 21:47:05 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2021-05-26 21:54:33 +0200 |
commit | 5226a6f56bdf64502bc86d8892d9d59ed5c6bc5a (patch) | |
tree | cc56284fcc793516c6a0cf50384ce25fb674a5bb /.github/workflows/test.yml | |
parent | d9710a242d5997c0f4abac5251a4ded44381c44b (diff) |
Replace Travis with GitHub actions
This includes a few tweaks to the test scripts to make debugging easier
and to avoid issues on Github action runners.
Diffstat (limited to '.github/workflows/test.yml')
-rw-r--r-- | .github/workflows/test.yml | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..97df4bd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,70 @@ +--- + +name: Test + +on: + push: + pull_request: + schedule: + - cron: '9 0 * * 1' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -y install + apparmor-utils + docbook-xml + docbook2x + expect + ldap-utils + libkrb5-dev + libldap2-dev + libpam0g-dev + libsasl2-dev + pylint + python3 + python3-daemon + python3-ldap + python3-pyasn1 + python3-pyasn1-modules + python3-setproctitle + slapd + xmlto + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure + --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc + --libdir=/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH` + --with-pam-seclib-dir=/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/security + --enable-warnings --enable-pynslcd + - name: make + run: make + - name: make distcheck + run: make distcheck || ( cat nss-pam-ldapd-*/_build/sub/tests/test-suite.log 2> /dev/null; exit 1 ) + # Set up a custom LDAP server + - name: service slapd stop + run: sudo service slapd stop || true + - name: aa-disable slapd + run: sudo aa-disable slapd + - name: start custom LDAP server + run: tmpslapd="$(sudo mktemp -d -t slapd.XXXXXX)" && sudo tests/setup_slapd.sh "$tmpslapd" setup && sudo tests/setup_slapd.sh "$tmpslapd" start || sudo tests/setup_slapd.sh "$tmpslapd" start -d 320 + # Set up the system to use LDAP for authentication + - name: make install + run: sudo make install + - name: testenv.sh enable_nss + run: sudo tests/testenv.sh enable_nss passwd group shadow networks protocols services ethers rpc netgroup aliases + - name: testenv.sh enable_pam + run: sudo tests/testenv.sh enable_pam + - name: configure /etc/nslcd.conf + run: sudo su -c "cat tests/nslcd-test.conf > /etc/nslcd.conf && chmod 640 /etc/nslcd.conf && chown root:$(id -g -n) /etc/nslcd.conf" + # Run nslcd and run the tests + - name: start nslcd + run: sudo nslcd/nslcd + - name: check test set-up + run: sudo tests/testenv.sh check && sudo tests/testenv.sh check_nss passwd group shadow networks protocols services ethers rpc netgroup aliases + - name: make check + run: sudo rm -f /tmp/pynslcd_cache.sqlite; sudo make check || ( cat tests/test-suite.log 2> /dev/null; exit 1 ) |