-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: switch to GitHub Actions - step 3: 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 run 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".
- Loading branch information
Showing
2 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Quicktest | ||
|
||
on: | ||
# Run on pushes, including merges, to all branches except `master`. | ||
push: | ||
branches-ignore: | ||
- master | ||
paths-ignore: | ||
- '**.md' | ||
- 'docs/**' | ||
|
||
jobs: | ||
#### QUICK TEST STAGE #### | ||
# This is a much quicker test which only runs the unit tests and linting against the low/high | ||
# supported PHP/PHPCS combinations. | ||
# These are basically the same builds as in the Test->Coverage workflow, but then without doing | ||
# the code-coverage. | ||
quicktest: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: ['5.4', 'latest'] | ||
phpcs_version: ['dev-master'] | ||
|
||
include: | ||
- php: '7.3' | ||
phpcs_version: '2.9.2' | ||
- php: '5.4' | ||
phpcs_version: '2.6.0' | ||
|
||
name: "QTest${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# On stable PHPCS versions, 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. | ||
- name: Setup ini config | ||
id: set_ini | ||
run: | | ||
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then | ||
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED' | ||
else | ||
echo '::set-output name=PHP_INI::error_reporting=E_ALL' | ||
fi | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
ini-values: ${{ steps.set_ini.outputs.PHP_INI }} | ||
coverage: none | ||
|
||
- name: 'Composer: set PHPCS version for tests' | ||
run: composer require --no-update squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" | ||
|
||
# Install dependencies and handle caching in one go. | ||
# @link https://github.com/marketplace/actions/install-composer-dependencies | ||
- name: Install Composer dependencies | ||
uses: "ramsey/composer-install@v1" | ||
|
||
- name: Lint against parse errors | ||
if: matrix.phpcs_version == 'dev-master' | ||
run: composer lint | ||
|
||
- name: Run the unit tests | ||
run: vendor/bin/phpunit --no-coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters