Skip to content

Commit b8c8e3b

Browse files
committed
TEMP/TESTING - enable test workflow with filter
1 parent 46957d2 commit b8c8e3b

File tree

1 file changed

+10
-148
lines changed

1 file changed

+10
-148
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
# Run on pushes to `master` and on all pull requests.
55
# Prevent the build from running when there are only irrelevant changes.
66
push:
7-
branches:
8-
- master
9-
tags:
10-
- '**'
11-
paths-ignore:
12-
- '**.md'
7+
# branches:
8+
# - master
9+
# tags:
10+
# - '**'
11+
# paths-ignore:
12+
# - '**.md'
1313
pull_request:
1414
# Allow manually triggering the workflow.
1515
workflow_dispatch:
@@ -37,144 +37,6 @@ jobs:
3737
# https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
3838
createAttestations: ${{ github.ref_type == 'tag' }}
3939

40-
test:
41-
# Cancels all previous runs of this particular job for the same branch that have not yet completed.
42-
concurrency:
43-
# The concurrency group contains the workflow name, job name, job index and the branch name.
44-
group: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index }}-${{ github.ref }}
45-
cancel-in-progress: true
46-
47-
runs-on: ubuntu-latest
48-
needs: build
49-
50-
strategy:
51-
# Keys:
52-
# - custom_ini: Whether to run with specific custom ini settings to hit very specific
53-
# code conditions.
54-
matrix:
55-
os: ['ubuntu-latest', 'windows-latest']
56-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
57-
custom_ini: [false]
58-
59-
exclude:
60-
# Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours).
61-
- php: '5.4'
62-
os: 'windows-latest'
63-
64-
include:
65-
# Skip test runs on builds which are also run in the coverage job.
66-
# Note: the tests on PHP 7.2 will still be run as the coverage build uses custom_ini settings for that version.
67-
- php: '5.4'
68-
os: 'ubuntu-latest'
69-
skip_tests: true
70-
- php: '5.5'
71-
os: 'windows-latest'
72-
skip_tests: true
73-
- php: '8.4'
74-
skip_tests: true
75-
76-
# Extra builds running only the unit tests with different PHP ini settings.
77-
- php: '5.5'
78-
os: 'ubuntu-latest'
79-
custom_ini: true
80-
- php: '7.0'
81-
os: 'ubuntu-latest'
82-
custom_ini: true
83-
84-
# yamllint disable-line rule:line-length
85-
name: "PHP: ${{ matrix.php }} ${{ matrix.custom_ini && ' with custom ini settings' || '' }} (${{ matrix.os == 'ubuntu-latest' && 'Linux' || 'Win' }})"
86-
87-
continue-on-error: ${{ matrix.php == '8.5' }}
88-
89-
steps:
90-
- name: Prepare git to leave line endings alone
91-
run: git config --global core.autocrlf input
92-
93-
- name: Checkout code
94-
uses: actions/checkout@v4
95-
96-
- name: Setup ini config
97-
id: set_ini
98-
shell: bash
99-
run: |
100-
# Set the "short_open_tag" ini to make sure specific conditions are tested.
101-
# Also turn on error_reporting to ensure all notices are shown.
102-
if [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" == '5.5' ]]; then
103-
echo 'PHP_INI=error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On, asp_tags=On' >> "$GITHUB_OUTPUT"
104-
elif [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" == '7.0' ]]; then
105-
echo 'PHP_INI=error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On' >> "$GITHUB_OUTPUT"
106-
else
107-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
108-
fi
109-
110-
- name: Install PHP
111-
uses: shivammathur/setup-php@v2
112-
with:
113-
php-version: ${{ matrix.php }}
114-
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
115-
coverage: none
116-
tools: cs2pr
117-
118-
# This action also handles the caching of the dependencies.
119-
- name: Set up node
120-
if: ${{ matrix.custom_ini == false }}
121-
uses: actions/setup-node@v4
122-
with:
123-
node-version: '20'
124-
125-
- name: Install external tools used in tests
126-
if: ${{ matrix.custom_ini == false }}
127-
run: >
128-
npm install -g --fund false
129-
csslint
130-
eslint
131-
jshint
132-
133-
# Install dependencies and handle caching in one go.
134-
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
135-
- name: Install Composer dependencies
136-
uses: "ramsey/composer-install@v3"
137-
with:
138-
composer-options: ${{ matrix.php == '8.5' && '--ignore-platform-req=php' || '' }}
139-
custom-cache-suffix: $(date -u "+%Y-%m")
140-
141-
# Note: The code style check is run multiple times against every PHP version
142-
# as it also acts as an integration test.
143-
- name: 'PHPCS: set the path to PHP'
144-
run: php "bin/phpcs" --config-set php_path php
145-
146-
- name: 'PHPUnit: run the full test suite without code coverage'
147-
if: ${{ matrix.skip_tests != true }}
148-
run: php "vendor/bin/phpunit" tests/AllTests.php --no-coverage
149-
150-
- name: 'PHPUnit: run select tests in CBF mode'
151-
run: php "vendor/bin/phpunit" tests/AllTests.php --group CBF --exclude-group nothing --no-coverage
152-
env:
153-
PHP_CODESNIFFER_CBF: '1'
154-
155-
- name: 'PHPCS: check code style without cache, no parallel'
156-
if: ${{ matrix.custom_ini == false && matrix.php != '7.4' }}
157-
run: php "bin/phpcs" --no-cache --parallel=1
158-
159-
- name: 'PHPCS: check code style to show results in PR'
160-
if: ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
161-
id: phpcs
162-
run: php "bin/phpcs" --no-cache --parallel=1 --report-full --report-checkstyle=./phpcs-report.xml
163-
164-
- name: Show PHPCS results in PR
165-
if: ${{ always() && steps.phpcs.outcome == 'failure' && matrix.php == '7.4' }}
166-
run: cs2pr ./phpcs-report.xml
167-
168-
- name: Download the PHPCS phar
169-
if: ${{ matrix.custom_ini == false }}
170-
uses: actions/download-artifact@v4
171-
with:
172-
name: phpcs-phar
173-
174-
# This test specifically tests that the Phar which will be released works correctly on all PHP versions.
175-
- name: 'PHPCS: check code style using the Phar file'
176-
if: ${{ matrix.custom_ini == false }}
177-
run: php phpcs.phar
17840

17941
coverage:
18042
# Explicitly *NOT* setting "concurrency" for this job to allow for monitoring code coverage for all merges.
@@ -276,11 +138,11 @@ jobs:
276138

277139
- name: "Run the unit tests with code coverage (PHPUnit < 9.3)"
278140
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION < '9.3' }}
279-
run: php "vendor/bin/phpunit" tests/AllTests.php
141+
run: php "vendor/bin/phpunit" tests/AllTests.php --filter ExpandRulesetReferenceTest
280142

281143
- name: "Run the unit tests with code coverage (PHPUnit 9.3+)"
282144
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION >= '9.3' }}
283-
run: php "vendor/bin/phpunit" tests/AllTests.php --coverage-cache ./build/phpunit-cache
145+
run: php "vendor/bin/phpunit" tests/AllTests.php --filter ExpandRulesetReferenceTest --coverage-cache ./build/phpunit-cache
284146

285147
- name: "Run select tests in CBF mode with code coverage (PHPUnit < 9.3)"
286148
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION < '9.3' }}
@@ -300,11 +162,11 @@ jobs:
300162

301163
- name: "Run the unit tests which may have different outcomes on Windows with code coverage (PHPUnit < 9.3)"
302164
if: ${{ matrix.os == 'windows-latest' && steps.phpunit_version.outputs.VERSION < '9.3' }}
303-
run: php "vendor/bin/phpunit" tests/AllTests.php --group Windows
165+
run: php "vendor/bin/phpunit" tests/AllTests.php --filter ExpandRulesetReferenceTest --group Windows
304166

305167
- name: "Run the unit tests which may have different outcomes on Windows with code coverage (PHPUnit 9.3+)"
306168
if: ${{ matrix.os == 'windows-latest' && steps.phpunit_version.outputs.VERSION >= '9.3' }}
307-
run: php "vendor/bin/phpunit" tests/AllTests.php --group Windows --coverage-cache ./build/phpunit-cache
169+
run: php "vendor/bin/phpunit" tests/AllTests.php --filter ExpandRulesetReferenceTest --group Windows --coverage-cache ./build/phpunit-cache
308170

309171
- name: "Upload coverage results to Coveralls (normal run)"
310172
if: ${{ success() }}

0 commit comments

Comments
 (0)