Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed May 17, 2024
1 parent 4286b05 commit 01e4193
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 301 deletions.
88 changes: 20 additions & 68 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,45 @@
name: Continuous integration checks
name: Continuous Integration

on:
# Run on PRs and pushes, only on significant changes.
push:
branches:
- develop
- main
- "develop"
- "main"
paths-ignore:
- '**.md'
- "**.md"
pull_request:
paths-ignore:
- '**.md'
- "**.md"

# Prevent multiple unnecessary CI runs on the same branch.
# Link: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
phpcs:
name: PHPCS check on PHP ${{ matrix.php }}
phpstan:
name: PHP static code analysis using PHP - ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4' ]

php: [ '8.2', '8.3' ]
steps:
# Checkout repository
- name: Checkout
uses: actions/checkout@v2

# Setup PHP versions, run checks
- name: PHP setup
uses: shivammathur/setup-php@v2
- name: PHP Static code analysis
uses: infinum/eightshift-deploy-actions-public/.github/actions/lint-php-static@main
with:
php-version: ${{ matrix.php }}
coverage: none
tools: cs2pr
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
ignore-cache: "yes"

- name: Check coding standards using PHPCS
continue-on-error: true
run: composer test:standards -- --runtime-set testVersion ${{ matrix.php }}- --report-full --report-checkstyle=./phpcs-report.xml

- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml
PHP_VERSION: ${{ matrix.php }}
PROJECT_PATH: ''

phpstan:
name: PHPStan check
phpcs:
name: PHP check coding standards using PHP - ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
php: [ '7.4' ]
allowed_failure: [ true ]

php: [ '8.2', '8.3' ]
steps:
# Checkout repository
- name: Checkout
uses: actions/checkout@v2

# Setup PHP versions, run checks
- name: PHP setup
uses: shivammathur/setup-php@v2
- name: PHP check coding standards
uses: infinum/eightshift-deploy-actions-public/.github/actions/lint-php@main
with:
php-version: ${{ matrix.php }}
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
ignore-cache: "yes"

- name: Check code consistency using PHPStan
run: composer test:types
PHP_VERSION: ${{ matrix.php }}
PROJECT_PATH: ''
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ When submitting issues or otherwise participating in development, please follow
Eightshift Forms is maintained and sponsored by [Infinum](https://infinum.com).

## ⚖️ License
Eightshift Forms ©2024 [Infinum](https://infinum.com). It is free software, and may be redistributed under the terms specified in the LICENSE file.
Eightshift Forms [Infinum](https://infinum.com). It is free software, and may be redistributed under the terms specified in the LICENSE file.
19 changes: 7 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@
"source": "https://github.com/infinum/eightshift-forms"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"infinum/eightshift-coding-standards": "^1.6",
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0",
"infinum/eightshift-coding-standards": "2.0.0-beta",
"php-parallel-lint/php-parallel-lint": "^1.3",
"php-stubs/wordpress-stubs": "^6.3",
"szepeviktor/phpstan-wordpress": "^1.3"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/infinum/eightshift-libs.git"
}
],
"require": {
"php": "^7.4 || >=8.0",
"infinum/eightshift-libs": "dev-feature/optimizations"
"php": ">=8.2",
"infinum/eightshift-libs": "dev-develop"
},
"suggest": {
"ext-pcov": "* || This extension is used for code coverage generation. Use either pcov, or xdebug, but not both.",
Expand All @@ -63,8 +58,8 @@
},
"scripts": {
"test:types": "@php ./vendor/bin/phpstan analyze",
"test:standards": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 7.4-",
"standards:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --runtime-set testVersion 7.4-",
"test:standards": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 8.2-",
"standards:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --runtime-set testVersion 8.2-",
"test": [
"@test:standards",
"@test:types"
Expand Down
Loading

0 comments on commit 01e4193

Please sign in to comment.