-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Yoast/feature/ghactions-various-improvements
GH Actions: various improvements
- Loading branch information
Showing
4 changed files
with
72 additions
and
13 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
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,58 @@ | ||
name: Lint | ||
|
||
on: | ||
# Run on all pushes and on all pull requests. | ||
push: | ||
pull_request: | ||
# 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: | ||
#### PHP Code Linting #### | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] | ||
|
||
name: "Lint: PHP ${{ matrix.php }}" | ||
|
||
continue-on-error: ${{ matrix.php == '8.2' }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On | ||
coverage: none | ||
|
||
- name: 'Composer: remove PHPUnit (not needed for lint)' | ||
run: composer remove phpunit/phpunit --no-update | ||
|
||
# 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 PHP files against parse errors - PHP < 7.0" | ||
if: ${{ matrix.php < 7.0 }} | ||
run: composer lint-lt70 | ||
|
||
- name: "Lint PHP files against parse errors - PHP 7.x" | ||
if: ${{ startsWith( matrix.php, '7' ) }} | ||
run: composer lint7 | ||
|
||
- name: "Lint PHP files against parse errors - PHP >= 8.0" | ||
if: ${{ matrix.php >= 8.0 }} | ||
run: composer lint-gte80 |
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
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