Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update workflows, switch to phpcsstandards/php_codesniffer #12

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ name: "Check Coding Standards"

on:
pull_request:
push:

jobs:
coding-standards:
name: "Check Coding Standards"

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v4

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
tools: composer:v2, cs2pr

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: Install dependencies
run: composer install --no-interaction --no-progress

- name: "Run phpcs"
- name: Run phpcs
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr
17 changes: 8 additions & 9 deletions .github/workflows/phpmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ name: "Check phpmd"

on:
pull_request:
push:

jobs:
coding-standards:
name: "Check phpmd"

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v4

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
tools: composer:v2

- name: "Install dependencies"
run: "composer require phpmd/phpmd --no-interaction --no-progress --no-suggest"
- name: Install dependencies
run: composer require phpmd/phpmd --no-interaction --no-progress

- name: "Run phpmd"
- name: Run phpmd
run: vendor/bin/phpmd classes/ text cleancode,codesize,controversial,design,naming,unusedcode
27 changes: 16 additions & 11 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: "PHPUnit tests"

on:
pull_request:
push:
schedule:
- cron: "0 0 * * *"

concurrency:
group: ${{ github.head_ref || 'cron' }}
cancel-in-progress: true

jobs:
phpunit:
name: PHPUnit tests on PHP ${{ matrix.php-version }}

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

strategy:
matrix:
Expand All @@ -21,28 +26,28 @@ jobs:
- "8.2"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v4

- name: "Install PHP"
uses: "shivammathur/setup-php@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: "Cache dependencies"
uses: "actions/cache@v2"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}"
restore-keys: "php-${{ matrix.php-version }}"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: Install dependencies
run: composer install --no-interaction --no-progress

- name: "Tests"
- name: Tests
run: vendor/bin/phpunit
16 changes: 8 additions & 8 deletions .github/workflows/test-flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ jobs:
coding-standards:
name: "Check test-flight"

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v4

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
tools: composer:v2
ini-values: "zend.assertions=1"

- name: "Install dependencies"
run: "composer require cundd/test-flight --no-interaction --no-progress --no-suggest"
- name: Install dependencies
run: composer require cundd/test-flight --no-interaction --no-progress

- name: "Run test-flight"
- name: Run test-flight
run: |
vendor/bin/test-flight README.md
vendor/bin/test-flight classes/
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require-dev": {
"phpunit/phpunit": "^8.5.13 || ^9.5",
"squizlabs/php_codesniffer": "^3.5"
"phpcsstandards/php_codesniffer": "^3.5"
},
"archive": {
"exclude": ["/tests"]
Expand Down