-
-
Notifications
You must be signed in to change notification settings - Fork 100
103 lines (86 loc) · 3.88 KB
/
quicktest.yml
File metadata and controls
103 lines (86 loc) · 3.88 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Quicktest
on:
# Run on pushes to all branches except the main branches.
push:
branches-ignore:
- 3.x
- 4.x
paths-ignore:
- '**.md'
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
#### QUICK TEST ####
# This is a much quicker test run which only runs the unit tests against the low/medium/high
# supported PHP versions and skips the PHAR test.
# These are basically the same builds as in the Test->Coverage workflow, but then without doing
# the code-coverage.
quicktest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-24.04-arm', 'windows-latest']
php: ['7.2', '8.1', 'latest']
name: "QuickTest: PHP ${{ matrix.php }} (${{ matrix.os == 'windows-latest' && 'Win' || 'Linux ARM' }})"
steps:
- name: Prepare git to leave line endings alone
run: git config --global core.autocrlf input
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
with:
php-version: ${{ matrix.php }}
ini-values: 'error_reporting=-1, display_errors=On, display_startup_errors=On'
coverage: none
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # 4.0.0
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
- name: Grab PHPUnit version
id: phpunit_version
shell: bash
# yamllint disable-line rule:line-length
run: echo "VERSION=$(php "vendor/bin/phpunit" --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
- name: "DEBUG: Show grabbed version"
run: echo ${{ steps.phpunit_version.outputs.VERSION }}
- name: Determine PHPUnit config file to use
id: phpunit_config
shell: bash
run: |
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
echo 'FILE=phpunit.xml.dist' >> "$GITHUB_OUTPUT"
elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
echo 'FILE=phpunit.xml.dist' >> "$GITHUB_OUTPUT"
else
echo 'FILE=phpunit-lte9.xml.dist' >> "$GITHUB_OUTPUT"
fi
- name: 'PHPCS: set the path to PHP'
run: php "bin/phpcs" --config-set php_path php
- name: 'PHPUnit: run the full test suite'
if: ${{ matrix.os != 'windows-latest' }}
run: php "vendor/bin/phpunit" -c ${{ steps.phpunit_config.outputs.FILE }} --no-coverage
- name: 'PHPUnit: run tests which may have different outcomes on Windows'
if: ${{ matrix.os == 'windows-latest' }}
run: >
php "vendor/bin/phpunit" -c ${{ steps.phpunit_config.outputs.FILE }} --no-coverage
--group Windows
- name: 'PHPUnit: run select tests in CBF mode'
run: >
php "vendor/bin/phpunit" -c ${{ steps.phpunit_config.outputs.FILE }} --no-coverage
--group CBF --exclude-group nothing
env:
PHP_CODESNIFFER_CBF: '1'
# Note: The code style check is run as an integration test.
- name: 'PHPCS: check code style without cache, no parallel'
run: php "bin/phpcs" --no-cache --parallel=1