Merge pull request #63 from flownative/task/cleanup #108
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
env: | |
PHP_EXTENSIONS: json, libxml, mbstring | |
PHP_INI_VALUES: assert.exception=1, zend.assertions=1, pcov.directory=Classes | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
- "8.4" | |
dependencies: | |
- lowest | |
- highest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install PHP with extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: xdebug | |
extensions: ${{ env.PHP_EXTENSIONS }} | |
ini-values: ${{ env.PHP_INI_VALUES }} | |
- name: Determine composer cache directory on Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | |
- name: Cache dependencies installed with composer | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | |
- name: Install lowest dependencies with composer | |
if: matrix.dependencies == 'lowest' | |
run: composer update --no-ansi --no-interaction --no-progress --prefer-lowest | |
- name: Install highest dependencies with composer | |
if: matrix.dependencies == 'highest' | |
run: composer update --no-ansi --no-interaction --no-progress | |
- name: Show modules | |
run: php -i; php -m | |
- name: Run tests with phpunit | |
run: vendor/bin/phpunit --coverage-clover=coverage.xml | |
- name: Send code coverage report to Codecov.io | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |