Skip to content

Commit

Permalink
Merge pull request #782 from daveroverts/ci-and-more
Browse files Browse the repository at this point in the history
Ci and more
  • Loading branch information
daveroverts authored Feb 10, 2024
2 parents d451347 + e89a9a6 commit ff97070
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 163 deletions.
22 changes: 13 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
],
"service": "laravel.test",
"workspaceFolder": "/var/www/html",
"settings": {},
"extensions": [
// "mikestead.dotenv",
// "amiralizadeh9480.laravel-extra-intellisense",
// "ryannaddy.laravel-artisan",
// "onecentlin.laravel5-snippets",
// "onecentlin.laravel-blade"
],
"customizations": {
"vscode": {
"extensions": [
// "mikestead.dotenv",
// "amiralizadeh9480.laravel-extra-intellisense",
// "ryannaddy.laravel-artisan",
// "onecentlin.laravel5-snippets",
// "onecentlin.laravel-blade"
],
"settings": {}
}
},
"remoteUser": "sail",
"postCreateCommand": "chown -R 1000:1000 /var/www/html 2>/dev/null || true"
// "forwardPorts": [],
// "runServices": [],
// "postCreateCommand": "apt-get update && apt-get install -y curl",
// "shutdownAction": "none",
}
29 changes: 13 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug
tools: phpcs, phpcpd

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Start mysql service
run: sudo systemctl start mysql.service

Expand All @@ -63,7 +68,7 @@ jobs:
run: php artisan config:clear

- name: Setup NPM
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "npm"
Expand All @@ -85,12 +90,6 @@ jobs:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
# REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

- name: PHP_CodeSniffer
run: phpcs --extensions=php app

- name: Copy/Paste Detector
run: phpcpd app/ --min-lines=50

test-php-postgresql:
name: Test PHP ${{ matrix.php-versions }} (${{ matrix.stability }}) + Node ${{ matrix.node }} + ${{ matrix.os }} with PostgreSQL
runs-on: ubuntu-latest
Expand Down Expand Up @@ -136,7 +135,11 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pgsql
coverage: xdebug
tools: phpcs, phpcpd

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- uses: ramsey/composer-install@v2

Expand All @@ -146,7 +149,7 @@ jobs:
php artisan key:generate
- name: Setup NPM
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "npm"
Expand All @@ -170,9 +173,3 @@ jobs:
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
# REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

- name: PHP_CodeSniffer
run: phpcs --extensions=php app

- name: Copy/Paste Detector
run: phpcpd app/ --min-lines=50
44 changes: 44 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Code analysis

on:
push:
paths:
- "**.php"
jobs:
phpcs:
name: PHP_CodeSniffer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: "8.3"
extensions: mbstring, dom, fileinfo
tools: phpcs

- uses: ramsey/composer-install@v2

- name: Run PHP_CodeSniffer
run: phpcs --extensions=php app

phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: "8.3"
extensions: mbstring, dom, fileinfo
tools: phpstan

- uses: ramsey/composer-install@v2

- name: Run PHPStan
run: phpstan analyse
2 changes: 1 addition & 1 deletion .github/workflows/pint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: "laravel-pint"
uses: aglipanci/[email protected].0
uses: aglipanci/[email protected].1
with:
verboseMode: true
testMode: true
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"barryvdh/laravel-ide-helper": "^2.13",
"beyondcode/laravel-query-detector": "^1.7",
"fakerphp/faker": "^1.18",
"larastan/larastan": "^2.0",
"laravel/pint": "^1.10",
"laravel/sail": "^1.13",
"laravel/sail": "^1.27",
"mockery/mockery": "^1.5",
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"pestphp/pest-plugin-livewire": "^2.0",
Expand Down
207 changes: 103 additions & 104 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ff97070

Please sign in to comment.