-
Notifications
You must be signed in to change notification settings - Fork 17
71 lines (63 loc) · 2.23 KB
/
phpunit-tests-run.yml
File metadata and controls
71 lines (63 loc) · 2.23 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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Run PHPUnit tests
on:
workflow_call:
inputs:
os:
description: 'Operating system to run tests on'
required: false
type: 'string'
default: 'ubuntu-latest'
php:
description: 'The version of PHP to use, in the format of X.Y'
required: true
type: 'string'
phpunit-config:
description: 'The PHPUnit configuration file to use'
required: false
type: 'string'
default: 'phpunit.xml.dist'
env:
LOCAL_PHP: ${{ inputs.php }}-fpm
PHPUNIT_CONFIG: ${{ inputs.phpunit-config }}
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
jobs:
phpunit-tests:
name: ${{ inputs.os }}
runs-on: ${{ inputs.os }}
# These tests can really drag on Windows CI runner!
timeout-minutes: 60
steps:
# Dev drive speeds up Windows CI tests from ~25 minutes to ~15 minutes
- name: Setup RAM Disk (Windows only)
uses: samypr100/setup-dev-drive@v3
with:
drive-size: 15GB
if: ${{ inputs.os == 'windows-latest' }}
- name: Create DEV_DRIVE/tmp and set TEMP and TMP (Windows only)
if: ${{ inputs.os == 'windows-latest' }}
run: |
echo "Setting TEMP and TMP to ${{ env.DEV_DRIVE }}\tmp"
env:
DEV_DRIVE: ${{ env.DEV_DRIVE }}
TEMP: ${{ env.DEV_DRIVE }}\tmp
TMP: ${{ env.DEV_DRIVE }}\tmp
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ inputs.php }}'
tools: phpunit-polyfills
extensions: zip, sqlite3, pdo, pdo_sqlite
ini-values: |
${{ inputs.os == 'windows-latest' && format('sys_temp_dir={0}/tmp', env.DEV_DRIVE) || '' }}
- name: Install Composer dependencies (using composer-ci-matrix-tests.json)
run: |
rm composer.lock
cp composer-ci-matrix-tests.json composer.json
composer install --no-interaction --no-progress --optimize-autoloader
- name: Run PHPUnit tests
# Explicitly use the composer-installed version of phpunit
# because there have been conflicts with other versions during CI.
run: vendor/bin/phpunit -c phpunit.xml