From 7db7d7051a240da89e41618fc7eeb5617a01d7a1 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 27 Nov 2025 12:37:41 +0100 Subject: [PATCH 1/3] add test script to composer.json --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 5aa3aeb..f2b3560 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,8 @@ }, "require-dev": { "phpunit/phpunit": "^12.4" + }, + "scripts": { + "test": "phpunit --config phpunit.xml --testdox" } } From 38a408bff0759c55961fd8f4d312983c976d4a6d Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 27 Nov 2025 12:37:58 +0100 Subject: [PATCH 2/3] add tests.yaml --- .github/workflows/tests.yaml | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..7075001 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,44 @@ +name: Tests + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: [ '8.4', '8.5' ] + + name: Run tests on PHP v${{ matrix.php-version }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: Set composer cache directory + id: composer-cache + run: echo "COMPOSER_CACHE_DIRECTORY=$(composer config cache-files-dir)" >> $GITHUB_ENV + + - name: Restore composer from cache + uses: actions/cache@v4 + with: + path: ${{ env.COMPOSER_CACHE_DIRECTORY }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Run phpunit tests + run: composer test From 328840acacebb1c62d3100d338e0cf623661ce97 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 27 Nov 2025 13:12:06 +0100 Subject: [PATCH 3/3] install lz4 extension in tests.yaml --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7075001..7b924a6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,6 +25,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: lz4 - name: Set composer cache directory id: composer-cache