diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml new file mode 100644 index 0000000..7fb67fa --- /dev/null +++ b/.github/workflows/formats.yml @@ -0,0 +1,44 @@ +name: Formats + +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + php: [8.1, 8.2] + + name: PHP ${{ matrix.php }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP Action + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: curl, xml, mbstring, zip + coverage: none + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Coding style checks + run: vendor/bin/phpcs + + - name: Static analysis checks + run: vendor/bin/phpcs