Skip to content

Commit

Permalink
chore: Update workflows, switch to phpcsstandards/php_codesniffer (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra authored Dec 1, 2023
1 parent 7bb0065 commit cb3402f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 38 deletions.
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

0 comments on commit cb3402f

Please sign in to comment.