xref: /plugin/pureldap/.github/workflows/phpTestActiveDirectory.yml (revision a1fd61bad19af47d542046b33c29833512eb7d62)
1name: Tests for AD
2
3on: [push, pull_request]
4
5jobs:
6    testAD:
7        name: PHP ${{ matrix.php-versions }} DokuWiki ${{ matrix.dokuwiki-branch }}
8        runs-on: macos-10.15
9        if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
10
11        strategy:
12            matrix:
13                php-versions: ['7.4']
14                dokuwiki-branch: [ 'master']
15            fail-fast: false
16
17        steps:
18            - name: Cache Vagrant boxes
19              uses: actions/cache@v2
20              with:
21                path: ~/.vagrant.d/boxes
22                key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
23                restore-keys: |
24                    ${{ runner.os }}-vagrant-
25
26            - name: Install AD
27              run: |
28                  wget https://github.com/splitbrain/vagrant-active-directory/archive/refs/heads/master.zip
29                  unzip master.zip
30                  rm master.zip
31                  cd vagrant-active-directory-master
32                  vagrant up
33                  cd ..
34
35            - name: Checkout
36              uses: actions/checkout@v2
37
38            - name: Setup PHP
39              uses: shivammathur/setup-php@v2
40              with:
41                  php-version: ${{ matrix.php-versions }}
42                  extensions: mbstring, intl, PDO, pdo_sqlite, bz2
43
44            - name: Setup problem matchers
45              run: |
46                echo ::add-matcher::${{ runner.tool_cache }}/php.json
47                echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json
48
49            - name: Download DokuWiki Test-setup
50              run: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh
51
52            - name: Run DokuWiki Test-setup
53              env:
54                  CI_SERVER: 1
55                  DOKUWIKI: ${{ matrix.dokuwiki-branch }}
56              run: sh travis.sh
57
58            - name: Setup PHPUnit
59              run: |
60                  php _test/fetchphpunit.php
61                  cd _test
62
63            - name: Run PHPUnit
64              run: |
65                cd _test
66                php phpunit.phar --verbose --stderr --group plugin_pureldap
67