Merge pull request #19 from iamarsenibragimov/patch-1 #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Continuous Integration" | |
on: | |
push: | |
pull_request: | |
jobs: | |
coding-standards: | |
name: "Check Coding Standards" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "8.1" | |
tools: "composer:v2" | |
- name: "Install dependencies" | |
uses: "ramsey/composer-install@v3" | |
with: | |
dependency-versions: "highest" | |
- name: "Run phpcs" | |
run: "vendor/bin/phpcs -n" | |
static-analysis: | |
name: "Static Analysis" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "8.1" | |
tools: "composer:v2" | |
- name: "Install dependencies" | |
uses: "ramsey/composer-install@v3" | |
with: | |
dependency-versions: "highest" | |
- name: "Run psalm" | |
run: "vendor/bin/psalm" | |
code-coverage: | |
name: "Code coverage" | |
needs: [ "coding-standards", "static-analysis" ] | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "pcov" | |
php-version: "8.3" | |
tools: "composer:v2" | |
- name: "Install dependencies" | |
uses: "ramsey/composer-install@v3" | |
with: | |
dependency-versions: "highest" | |
- name: "Run tests" | |
run: "vendor/bin/phpunit --coverage-clover=coverage.xml" | |
- name: "Upload coverage reports to Codecov" | |
uses: "codecov/codecov-action@v4" | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
tests: | |
name: "PHPUnit tests" | |
needs: ["code-coverage"] | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
dependencies: | |
- "highest" | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
include: | |
- php-version: "8.1" | |
dependencies: "lowest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
tools: "composer:v2" | |
- name: "Install dependencies" | |
uses: "ramsey/composer-install@v3" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Run tests" | |
run: "vendor/bin/phpunit --no-coverage" |