-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (46 loc) · 1.89 KB
/
test.yml
File metadata and controls
58 lines (46 loc) · 1.89 KB
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
name: Run Extension Unit Tests
on:
workflow_call:
inputs:
matrix-json:
description: 'The matrix configuration as JSON. Need to supply arrays `php-version` and `dokuwiki-branch`.'
required: true
type: string
default: '{"php-version": ["7.4", "8.0", "8.1", "8.2"], "dokuwiki-branch": ["master", "stable"]}'
permissions:
contents: read
pull-requests: read
jobs:
test:
name: PHP ${{ matrix.php-version }} DokuWiki ${{ matrix.dokuwiki-branch }}
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
COMPOSER: _test/composer.json
COMPOSER_VENDOR_DIR: _test/vendor
strategy:
matrix: ${{ fromJson(inputs.matrix-json) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, PDO, pdo_sqlite, bz2
- name: Setup problem matchers
run: |
echo ::add-matcher::${{ runner.tool_cache }}/php.json
echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json
- name: Create DokuWiki Environment
id: dokuwiki-env
uses: dokuwiki/github-action/.github/actions/dokuenv@main
with:
branch: ${{ matrix.dokuwiki-branch }}
- name: Install Composer Dependencies
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --no-scripts
- name: Check Syntax
run: find ${{ steps.dokuwiki-env.outputs.dir }} -name '*.php' -not -path '*/vendor/*' -print0 | xargs -0L1 php -l
- name: Run PHPUnit
run: composer exec -- phpunit -c _test/phpunit.xml --verbose --stderr --group ${{ steps.dokuwiki-env.outputs.type }}_${{ steps.dokuwiki-env.outputs.base }}