Skip to content

Commit c1a0772

Browse files
committed
GH Actions: introduce a quicktest workflow
... which runs only against low/medium/high PHP versions and does not run: - the tests using custom PHP ini settings - the tests related to sniffs using external JS/CSS tooling - test CS check (integration test) using the PHAR This quick test workflow will now run on pushes to all branches except `master`. For pushes to `master`, the full test build will still be run. In the fast majority of cases, this quicktest will already surface any issues and it saves a lot of resources when the same builds don't run twice for every PR.
1 parent 3ecf4ba commit c1a0772

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

.github/workflows/quicktest.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Quicktest
2+
3+
on:
4+
# Run on pushes to all branches except for `master`.
5+
push:
6+
branches-ignore:
7+
- master
8+
paths-ignore:
9+
- '**.md'
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch:
12+
13+
# Cancels all previous workflow runs for the same branch that have not yet completed.
14+
concurrency:
15+
# The concurrency group contains the workflow name and the branch name.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
#### QUICK TEST ####
21+
# This is a much quicker test run which only runs the unit tests against the low/medium/high
22+
# supported PHP versions and skips the PHAR test and the tests for external JS/CSS tooling.
23+
# These are basically the same builds as in the Test->Coverage workflow, but then without doing
24+
# the code-coverage.
25+
quicktest:
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
matrix:
30+
php: ['5.4', '7.2', 'latest']
31+
32+
name: "QuickTest: PHP ${{ matrix.php }}"
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Install PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
ini-values: 'error_reporting=-1, display_errors=On'
43+
coverage: none
44+
45+
# Install dependencies and handle caching in one go.
46+
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
47+
- name: Install Composer dependencies
48+
uses: "ramsey/composer-install@v2"
49+
with:
50+
# Bust the cache at least once a month - output format: YYYY-MM.
51+
custom-cache-suffix: $(date -u "+%Y-%m")
52+
53+
- name: 'PHPCS: set the path to PHP'
54+
run: php bin/phpcs --config-set php_path php
55+
56+
- name: 'PHPUnit: run the tests'
57+
run: vendor/bin/phpunit tests/AllTests.php
58+
59+
# Note: The code style check is run as an integration test.
60+
- name: 'PHPCS: check code style without cache, no parallel'
61+
run: php bin/phpcs --no-cache --parallel=1

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Test
22

33
on:
4-
# Run on all pushes and on all pull requests.
4+
# 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
79
paths-ignore:
810
- '**.md'
911
pull_request:

0 commit comments

Comments
 (0)