-
-
Notifications
You must be signed in to change notification settings - Fork 490
82 lines (69 loc) · 2.71 KB
/
quicktest.yml
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
name: Quick Tests
on:
push:
branches-ignore:
- main
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:
# Performs some quick tests.
# This is a much quicker test suite which only runs the unit tests and linting
# against the low/high supported PHP/PHPCS combinations.
quick-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '5.4', 'latest' ]
dependencies: [ 'lowest', 'stable' ]
name: QTest - PHP ${{ matrix.php }} on PHPCS ${{ matrix.dependencies }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# With stable PHPCS dependencies, allow for PHP deprecation notices.
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
ini-values: error_reporting=-1, display_errors=On
coverage: ${{ github.ref_name == 'develop' && 'xdebug' || 'none' }}
- name: Enable creation of `composer.lock` file
if: ${{ matrix.dependencies == 'lowest' }}
run: composer config --unset lock
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
- name: "Composer: downgrade PHPCS dependencies for tests (lowest)"
if: ${{ matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra
- name: Lint PHP files against parse errors
if: ${{ matrix.dependencies == 'stable' }}
run: composer lint
- name: Run the unit tests without code coverage
if: ${{ github.ref_name != 'develop' }}
run: composer run-tests
- name: Run the unit tests with code coverage
if: ${{ github.ref_name == 'develop' }}
run: composer coverage
- name: Send coverage report to Codecov
if: ${{ success() && github.ref_name == 'develop' }}
uses: codecov/codecov-action@v5
with:
files: ./build/logs/clover.xml
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}