-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions, update phpstan rules
- Loading branch information
Showing
4 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Coding Standards" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "main" | ||
|
||
push: | ||
branches: | ||
- "master" | ||
- "main" | ||
- "*.x" | ||
|
||
jobs: | ||
coding-standards: | ||
name: "Coding Standards" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "7.4" | ||
extensions: "redis" | ||
tools: "composer:v2,cs2pr" | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--prefer-dist --optimize-autoloader" | ||
|
||
- name: "Check code style" | ||
run: "./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "main" | ||
|
||
push: | ||
branches: | ||
- "master" | ||
- "main" | ||
- "*.x" | ||
|
||
jobs: | ||
phpunit: | ||
name: "PHPUnit" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
- "8.0" | ||
- "8.1" | ||
dependencies: | ||
- "highest" | ||
stability: | ||
- "stable" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: "Install PHP with PCOV" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
coverage: "pcov" | ||
ini-values: "zend.assertions=1, apc.enable_cli=1" | ||
extensions: "redis,apcu" | ||
tools: "composer:v2,flex" | ||
|
||
- name: "Enforce using stable dependencies" | ||
run: "composer config minimum-stability stable" | ||
if: "${{ matrix.stability == 'stable' }}" | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
dependency-versions: "${{ matrix.dependencies }}" | ||
composer-options: "--prefer-dist --optimize-autoloader" | ||
|
||
- name: "Run PHPUnit" | ||
run: "./vendor/bin/phpunit" | ||
|
||
# - name: "Upload coverage file" | ||
# uses: "actions/upload-artifact@v2" | ||
# with: | ||
# name: "phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}.coverage" | ||
# path: "clover.xml" | ||
|
||
# upload_coverage: | ||
# name: "Upload coverage to Codecov" | ||
# runs-on: "ubuntu-latest" | ||
# needs: | ||
# - "phpunit" | ||
# | ||
# steps: | ||
# - name: "Checkout" | ||
# uses: "actions/checkout@v2" | ||
# with: | ||
# fetch-depth: 2 | ||
# | ||
# - name: "Download coverage files" | ||
# uses: "actions/download-artifact@v2" | ||
# with: | ||
# path: "reports" | ||
# | ||
# - name: "Upload to Codecov" | ||
# uses: "codecov/codecov-action@v1" | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
# with: | ||
# directory: reports | ||
# | ||
# - name: "Upload to CodeClimate" | ||
# uses: "paambaati/[email protected]" | ||
# env: | ||
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
# with: | ||
# coverageLocations: | | ||
# ${{github.workspace}}/reports/*/clover.xml:clover |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Static Analysis" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "main" | ||
|
||
push: | ||
branches: | ||
- "master" | ||
- "main" | ||
- "*.x" | ||
|
||
jobs: | ||
static-analysis: | ||
name: "Static Analysis" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "7.4" | ||
extensions: "redis" | ||
tools: "composer:v2" | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--prefer-dist --optimize-autoloader" | ||
|
||
- name: "Run PHPStan" | ||
run: "./vendor/bin/phpstan analyse --error-format=github" |
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