diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d049e6e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + static: + name: Static checks + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + coverage: none + + - name: Install dependencies + uses: ramsey/composer-install@v3 + + - run: composer validate --no-check-publish --no-interaction + - run: composer compat + - run: composer rector + + test: + name: PHP ${{ matrix.php }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.2', '8.3', '8.4'] + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Install dependencies + uses: ramsey/composer-install@v3 + + - run: composer test:unit diff --git a/composer.json b/composer.json index a08059e..251ed5c 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ }, "scripts":{ "test:unit":"./vendor/bin/pest --testdox --colors=always tests/ --exclude-group db", - "compat": "./vendor/bin/phpcs -p ./src --standard=PHPCompatibility --runtime-set testVersion 7.2", + "compat": "./vendor/bin/phpcs -p ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 7.4-", "rector": "./vendor/bin/rector process --dry-run" },