Added PHP Static Analysis to dev workflow #11
Workflow file for this run
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
# Continuous Integration (CI) pipeline. | |
# | |
# Any time code is pushed to one of the main branches or a PR is opened, this pipeline should be | |
# run to ensure everything still works as designed and meets our coding standards. | |
name: CI Pipeline | |
# Execute on pushes to develop or main, as well as all PRs. | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
# Cancel outstanding jobs for this workflow/branch combo. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Execute all PHPUnit tests. | |
phpunit: | |
name: PHPUnit (PHP ${{ matrix.php-versions }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['8.0', '8.1', '8.2', '8.3'] | |
services: | |
mysql: | |
image: mysql:${{ (matrix.php-versions < 7.4 && '5.7') || '8.0' }} | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Configure PHP environment | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, mysqli | |
coverage: none | |
- uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
- name: Run PHPStan | |
run: composer test:analysis | |
- name: Run PHPUnit | |
run: composer test:unit |