diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..25343da --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +/.github/ export-ignore +/.gitattributes export-ignore +/phpstan-baseline.neon export-ignore +/phpstan.neon export-ignore diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml new file mode 100644 index 0000000..83f3730 --- /dev/null +++ b/.github/workflows/integrate.yaml @@ -0,0 +1,57 @@ +# https://docs.github.com/en/actions + +name: "Integrate" + +on: + pull_request: null + push: + branches: + - "master" + +jobs: + static-code-analysis: + name: "Static Code Analysis" + + runs-on: "ubuntu-latest" + + timeout-minutes: 5 + + strategy: + matrix: + php-version: + - "7.1" + + steps: + - name: "Checkout" + uses: "actions/checkout@v3.5.3" + + - name: "Set up PHP" + uses: "shivammathur/setup-php@2.25.5" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Set up problem matchers for PHP" + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" + + - name: "Validate composer.json and composer.lock" + run: "composer validate --ansi --strict" + + - name: "Determine composer cache directory" + run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir}})\" >> $GITHUB_ENV" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v3.3.1" + with: + path: "${{ env.COMPOSER_CACHE_DIR }}" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" + + - name: "Install locked dependencies with composer" + run: "composer install --ansi --no-interaction --no-progress" + + - name: "Create cache directory for phpstan/phpstan" + run: "mkdir -p .build/phpstan/" + + - name: "Run phpstan/phpstan" + run: "vendor/bin/phpstan --ansi --configuration=phpstan.neon --memory-limit=-1" diff --git a/.gitignore b/.gitignore index 448541c..7be10aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.build/ composer.phar /vendor .DS_Store diff --git a/README.md b/README.md index a5ed0fc..ae7c69c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Bannerbear PHP Library +[![Integrate](https://github.com/yongfook/bannerbear-php/workflows/Integrate/badge.svg)](https://github.com/yongfook/bannerbear-php/actions) + A PHP wrapper for the Bannerbear API - an image and video generation service. ## Documentation diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..846a8df --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,3 @@ +parameters: + ignoreErrors: [] + diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..670379d --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,10 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: 0 + + paths: + - src/ + + tmpDir: .build/phpstan/