Skip to content

Commit

Permalink
build: use ecs + phpstan, add gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdavies committed May 20, 2024
1 parent 1e8d912 commit 1e3da7a
Show file tree
Hide file tree
Showing 8 changed files with 5,880 additions and 2,919 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: latest
args: --profile --ignore-platform-reqs
- name: Run phpstan
uses: php-actions/composer@v6
with:
command: run-script phpstan
php_version: latest
- name: Run Check ECS
uses: php-actions/composer@v6
with:
command: run-script check-cs
php_version: latest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# COMPOSER
/vendor

composer.lock
# BUILD FILES
/bower_components/*
/node_modules/*
Expand Down
1 change: 0 additions & 1 deletion .php-cs-fixer.cache

This file was deleted.

42 changes: 0 additions & 42 deletions .php-cs-fixer.dist.php

This file was deleted.

21 changes: 13 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
}
],
"require": {
"php": "^8.2",
"craftcms/cms": "^5.0.0-beta.6"
"php": "^8.2 | ^8.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^1.4",
"vlucas/phpdotenv": "^3.0",
"craftcms/rector": "dev-main"
"symplify/easy-coding-standard": "^10.3",
"craftcms/cms": "^5.0.0-beta.1",
"craftcms/ecs": "dev-main",
"nunomaduro/collision": "^8.1",
"pestphp/pest": "^2.34",
"roave/security-advisories": "dev-latest",
"phpstan/phpstan": "^1.4",
"vlucas/phpdotenv": "^3.0"
},
"autoload": {
"psr-4": {
Expand All @@ -37,7 +40,8 @@
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse",
"cs": "vendor/bin/php-cs-fixer fix src --allow-risky=yes"
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --ansi --fix"
},
"extra": {
"name": "Sharing Intents",
Expand All @@ -56,7 +60,8 @@
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
"craftcms/plugin-installer": true,
"pestphp/pest-plugin": true
}
}
}
Loading

0 comments on commit 1e3da7a

Please sign in to comment.