diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b61cce2..0c65b25 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,49 +10,57 @@ on: jobs: build: - - runs-on: ubuntu-latest - + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + php: ["8.1", "8.2", "8.3", "8.4"] env: + tools: composer, phpstan, infection extensions: bcmath, bz2, curl, gd, intl, ldap, mbstring, opcache, readline, sqlite3, tidy, xml, xsl, zip zlib pcre - ini-values: memory_limit=-1 + ini-values: memory_limit=-1,default_charset='UTF-8' + name: PHP ${{ matrix.php }} test on ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP with PECL extension - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - extensions: zlib,pcre,opcache,imagick, swoole - - - name: Know Me ! - run: lsb_release -a && uname -a && echo $(pwd) && php -v && php -m - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v4 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --ignore-platform-req=php - - - name: Copy phpunit and phpcs files - run: cp phpcs.xml.dist phpcs.xml && cp phpunit.xml.dist phpunit.xml - - - name: Run ch-check - run: composer run-script cs-check - - - name: Run cs-fix - run: composer run-script cs-fix - - - name: PHPUnit Test - run: composer run-script test + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: zlib,pcre,opcache,imagick, swoole + ini-values: ${{ env.ini-values }} + coverage: pcov + tools: ${{ env.tools }} + env: + fail-fast: true + - name: Know Me ! + run: lsb_release -a && uname -a && echo $(pwd) && php -v && php -m + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --ignore-platform-req=php + + - name: Copy phpunit and phpcs files + run: cp phpcs.xml.dist phpcs.xml && cp phpunit.xml.dist phpunit.xml + + - name: Run ch-check + run: composer run-script cs-check + + - name: Run cs-fix + run: composer run-script cs-fix + + - name: PHPUnit Test + run: composer run-script test