chore(actions): add test github action #1
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
name: Tests | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["*"] | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
php_version: ["7.4", "8.0", "8.1", "8.2", "8.3"] | |
runs-on: ubuntu-latest | |
container: | |
image: "lephare/php:${{ matrix.php_version }}" | |
env: | |
XDEBUG_MODE: coverage | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Install dependencies (PHP ${{ matrix.php_version }}) | |
run: | | |
composer config --global cache-dir .composer | |
composer install --prefer-dist --no-interaction --no-progress | |
- name: Coding Style (PHP ${{ matrix.php_version }}) | |
run: | | |
composer run-script lint:ci | |
composer run-script analyse | |
- name: Unit Tests (PHP ${{ matrix.php_version }}) | |
run: composer run-script test:ci |