Skip to content

Commit 89bb1c3

Browse files
committed
CI: switch to GitHub Actions - step 2: quick test stage
This commit: * Adds a GH Actions workflow for the CI checks which were previously run on Travis in the `quicktest` stage. * Removes that part of the `.travis.yml` configuration. Notes: 1. Previously, this "stage" would run on all `push` events, except when merging to `master` or `develop`. The current set-up still does so, with one exception: pushes to `develop` will now use this quicktest instead of the full test. `develop` is a protected branch anyhow, so all merges will already have had the full test run in the pull request. For merges to `master`, the full Test will still be used as that will generally mean we're getting ready to tag a release and some extra safety checking before a release is not a bad thing. 2. This also updates the "high" PHP version for the "quicktest" against PHPCS `dev-master` from PHP 7.4 to PHP 8.0 by using `latest` which translates to "latest stable PHP release".
1 parent 89d563a commit 89bb1c3

File tree

2 files changed

+80
-18
lines changed

2 files changed

+80
-18
lines changed

.github/workflows/quicktest.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Quicktest
2+
3+
on:
4+
# Run on pushes, including merges, to all branches except `master`.
5+
push:
6+
branches-ignore:
7+
- master
8+
paths-ignore:
9+
- '**.md'
10+
11+
jobs:
12+
#### QUICK TEST STAGE ####
13+
# This is a much quicker test which only runs the unit tests and linting against the low/high
14+
# supported PHP/PHPCS combinations.
15+
quicktest:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
php: ['5.4', 'latest']
21+
phpcs_version: ['dev-master']
22+
lint: [true]
23+
24+
include:
25+
- php: '7.2'
26+
phpcs_version: '3.1.0'
27+
lint: false
28+
- php: '5.4'
29+
phpcs_version: '3.1.0'
30+
lint: false
31+
32+
name: "QTest${{ matrix.lint && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
38+
# On stable PHPCS versions, allow for PHP deprecation notices.
39+
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
40+
- name: Setup ini config
41+
id: set_ini
42+
run: |
43+
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
44+
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED'
45+
else
46+
echo '::set-output name=PHP_INI::error_reporting=E_ALL'
47+
fi
48+
49+
- name: Install PHP
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: ${{ matrix.php }}
53+
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
54+
coverage: none
55+
56+
- name: 'Composer: adjust dependencies'
57+
run: |
58+
# Set the PHPCS version to be used in the tests.
59+
composer require --no-update squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-scripts
60+
# Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs.
61+
composer remove --no-update --dev phpcsstandards/phpcsdevcs --no-scripts
62+
63+
# Install dependencies and handle caching in one go.
64+
# @link https://github.com/marketplace/actions/install-composer-dependencies
65+
- name: Install Composer dependencies
66+
uses: "ramsey/composer-install@v1"
67+
68+
- name: Lint against parse errors
69+
if: ${{ matrix.lint }}
70+
run: composer lint
71+
72+
# Check that any sniffs available are feature complete.
73+
# This also acts as an integration test for the feature completeness script,
74+
# which is why it is run against various PHP versions and not in the "Sniff" stage.
75+
- name: Check for feature completeness
76+
if: ${{ matrix.lint }}
77+
run: composer check-complete
78+
79+
- name: Run the unit tests
80+
run: composer run-tests

.travis.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,12 @@ env:
2929
# Note: for pull requests, "develop" is the base branch name.
3030
# See: https://docs.travis-ci.com/user/conditions-v1
3131
stages:
32-
- name: quicktest
33-
if: type = push AND branch NOT IN (stable, develop)
3432
- name: test
3533
if: branch IN (stable, develop)
3634

3735
jobs:
3836
fast_finish: true
3937
include:
40-
#### QUICK TEST STAGE ####
41-
# This is a much quicker test which only runs the unit tests and linting against the low/high
42-
# supported PHP/PHPCS combinations.
43-
- stage: quicktest
44-
php: 7.4
45-
env: PHPCS_VERSION="dev-master" LINT=1
46-
- php: 7.2
47-
env: PHPCS_VERSION="3.1.0"
48-
49-
- php: 5.4
50-
dist: trusty
51-
env: PHPCS_VERSION="dev-master" LINT=1
52-
- php: 5.4
53-
dist: trusty
54-
env: PHPCS_VERSION="3.1.0"
55-
5638
#### TEST STAGE ####
5739
# Additional builds to prevent issues with PHPCS versions incompatible with certain PHP versions.
5840
- stage: test

0 commit comments

Comments
 (0)