diff --git a/.gitattributes b/.gitattributes index 0af3009..e97f8e0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,3 @@ -.coveralls.yml export-ignore -.gitattributes export-ignore -.gitignore export-ignore -.travis.yml export-ignore -composer.json export-ignore +.* export-ignore phpunit.xml.dist export-ignore tests export-ignore diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..053bf7b --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,54 @@ +# yamllint disable rule:line-length +# yamllint disable rule:braces + +name: CI + +on: + pull_request: + push: + branches: + - main + - master + +jobs: + build: + name: Test with PHP ${{ matrix.php-version }} + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1" + - "8.2" + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Cache Composer packages + uses: actions/cache@v3 + with: + path: ~/.cache/composer + key: composer-${{ matrix.php-version }}-${{ hashFiles('composer.*') }} + restore-keys: | + composer-${{ matrix.php-version }}- + composer- + + - name: Install dependencies + run: | + composer install --prefer-dist --no-progress + + - name: PHP Parallel Lint + run: | + php vendor/bin/parallel-lint --exclude vendor . + + - name: PHPUnit + run: | + php vendor/bin/phpunit diff --git a/composer.json b/composer.json index c2f875c..112c577 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ }, "require-dev": { "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", - "php-coveralls/php-coveralls": "^2.0" + "php-coveralls/php-coveralls": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.3" }, "autoload": { "psr-4": { "Pleo\\BloomFilter\\": "src/" }