name: "Review PR" on: pull_request: env: COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" jobs: # This job ensures the coding standard is followed coding-standards: name: "Coding Standards" runs-on: ${{ matrix.operating-system }} strategy: matrix: php-version: - "7.4" operating-system: - "ubuntu-latest" steps: - name: "Checkout Code" uses: "actions/checkout@v2" - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: coverage: "pcov" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2 - name: Get Composer Cache Directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - name: "Cache dependencies" uses: "actions/cache@v2" with: path: ${{ steps.composer-cache.outputs.dir }} key: "composer-cache" restore-keys: "composer-cache" - name: "Install dependencies" run: "composer install ${{ env.COMPOSER_FLAGS }}" - name: "Coding Standard" run: "vendor/bin/php-cs-fixer fix --dry-run -vvv" type-analysis: name: "Type Coverage" runs-on: ${{ matrix.operating-system }} strategy: matrix: php-version: - "7.4" operating-system: - "ubuntu-latest" steps: - name: "Checkout Code" uses: "actions/checkout@v2" - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: coverage: "pcov" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2 - name: Get Composer Cache Directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - name: "Cache dependencies" uses: "actions/cache@v2" with: path: ${{ steps.composer-cache.outputs.dir }} key: "composer-cache" restore-keys: "composer-cache" - name: "Install dependencies" run: "composer install ${{ env.COMPOSER_FLAGS }}" - name: "Run Psalm" run: "vendor/bin/psalm --output-format=github --shepherd --stats" continue-on-error: true unit-test: name: "Unit Testing" runs-on: ${{ matrix.operating-system }} strategy: matrix: dependencies: - "lowest" - "highest" php-version: - "7.4" - "8.0" operating-system: - "ubuntu-latest" steps: - name: "Checkout Code" uses: "actions/checkout@v2" - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: coverage: "pcov" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2 - name: Get Composer Cache Directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - name: "Cache dependencies" uses: "actions/cache@v2" with: path: ${{ steps.composer-cache.outputs.dir }} key: "composer-cache" restore-keys: "composer-cache" - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} run: "composer update ${{ env.COMPOSER_FLAGS }} --prefer-lowest --ignore-platform-reqs" - name: "Install highest dependencies" if: ${{ matrix.dependencies == 'highest' }} run: "composer install ${{ env.COMPOSER_FLAGS }} --ignore-platform-reqs" - name: "Run PHPUnit" run: "vendor/bin/phpunit --testdox --coverage-text"