From 1fb2b0bbcb4a858cdffdb18ce98939024ca12ea8 Mon Sep 17 00:00:00 2001 From: Alexandr Smirnov Date: Tue, 25 Jun 2024 21:12:22 +0300 Subject: [PATCH] Add matrix 7.4, 8.1, 8.2, 8.3 --- .github/workflows/php.yml | 39 ------------------ .github/workflows/test.yaml | 80 +++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/php.yml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index 7145fe0..0000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: PHP Composer - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - - name: Run test suite - run: composer run-script test diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..8b6d6d9 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,80 @@ + name: Test + + on: + push: + branches: [ "master", "dev" ] + pull_request: + branches: [ "master", "dev" ] + + permissions: + contents: read + + jobs: + + + test: + #name: PHP ${{ matrix.php-version }} + name: PHP ${{ matrix.php }} - ${{ matrix.phpunit }} - ${{ matrix.stability }} + runs-on: ubuntu-20.04 + + strategy: + fail-fast: true + matrix: + php: [7.4, 8.1, 8.2, 8.3] + phpunit: ['9.6.16'] + # stability: [prefer-lowest, prefer-stable] + stability: [prefer-dist] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, :php-psr #sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp, + ini-values: error_reporting=E_ALL + tools: composer:v2 + coverage: none + #env: + #REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 + #REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev + + # - name: Validate composer.json and composer.lock + # run: composer validate --strict + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + #key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + #restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}- + + # - name: Install dependencies + # run: composer install --prefer-dist + + - name: Set PHPUnit + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 10 + command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update + + - name: Install dependencies + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 10 + command: composer update --${{ matrix.stability }} --no-interaction --no-progress + + - name: Run Tests + run: vendor/bin/phpunit +