Skip to content

Commit

Permalink
Merge pull request #128 from johanvanhelden/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
johanvanhelden authored Sep 26, 2024
2 parents 9c8cdee + 012f155 commit 99b7ef6
Show file tree
Hide file tree
Showing 125 changed files with 3,612 additions and 8,153 deletions.
12 changes: 10 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
quote_type = single

[docker-compose.yml]
indent_size = 4

[*{Makefile,makefile,.mk}]
indent_style = tab
tab_width = 4
17 changes: 0 additions & 17 deletions .env.dusk.local.example

This file was deleted.

21 changes: 13 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ APP_KEY=base64:nkI3QCNcgUCBa1lKT8XrhKiiESO7cf8a88wRlfLTxss=
APP_DEBUG=true
APP_URL=http://johanvanhelden.localtest.me

LOG_STACK=daily,syslog
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=stack
LOG_LEVEL=debug

DEBUGBAR_ENABLED=true
DEBUGBAR_DRIVER=redis
DEBUGBAR_EDITOR=vscode
DEBUGBAR_THEME=dark
DEBUGBAR_SHOW_BACKTRACE=true
DEBUGBAR_SHOW_EVENTS=false
DEBUGBAR_SHOW_GATES=false
DEBUGBAR_SHOW_LOGS=false
DEBUGBAR_SHOW_VIEW_DATA=false
DEBUGBAR_ENABLED=true
DEBUGBAR_OPEN_STORAGE=true
DEBUGBAR_REMOTE_SITES_PATH="/var/www/projects/"
DEBUGBAR_LOCAL_SITES_PATH="/home/USERNAME/projects/"

Expand All @@ -27,7 +24,7 @@ IGNITION_LOCAL_SITES_PATH="/home/USERNAME/projects/"

BROADCAST_DRIVER=log

CACHE_DRIVER=redis
CACHE_STORE=redis
CACHE_PREFIX=johanvanhelden_local_cache

QUEUE_CONNECTION=redis
Expand All @@ -39,7 +36,10 @@ SESSION_ENCRYPT=true
SESSION_COOKIE=johanvanhelden_local_session
SESSION_DOMAIN=johanvanhelden.localtest.me
SESSION_SECURE_COOKIE=false
SESSION_HTTP_ONLY=true
SESSION_SAME_SITE="lax"

REDIS_CLIENT=phpredis
REDIS_HOST=dockerhero_redis
REDIS_PASSWORD=null
REDIS_PORT=6379
Expand All @@ -53,4 +53,9 @@ MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="example@address.com"
MAIL_FROM_NAME="${APP_NAME}"

VITE_APP_NAME="${APP_NAME}"

SENTRY_LARAVEL_DSN=

HORIZON_NOTIFY_EMAIL="email@address.com"

17 changes: 0 additions & 17 deletions .env.testing.example

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

*.blade.php diff=html
*.css diff=css
*.js linguist-vendored
*.html diff=html
*.md diff=markdown
*.php diff=php
Expand Down
22 changes: 0 additions & 22 deletions .github/dependabot.yml

This file was deleted.

138 changes: 32 additions & 106 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,175 +12,101 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Up PHP and Tools
uses: shivammathur/setup-php@master
with:
php-version: "8.1"
php-version: '8.3'
tools: composer:v2
coverage: none

- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: make vendor

- name: Static Code Analysis
run: ./vendor/bin/phpstan analyse --memory-limit=2G
run: make stan

code-style:
name: Code Style
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Up PHP and Tools
uses: shivammathur/setup-php@master
with:
php-version: "8.1"
tools: composer:v2, phpcs, php-cs-fixer, phpmd, phpcpd
php-version: '8.3'
tools: composer:v2, phpcs, php-cs-fixer, phpmd
coverage: none

- name: Install NPM
run: npm ci

- name: Syntax Errors
run: find app config lang routes tests -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
run: make syntax

- name: PHP_CodeSniffer
run: phpcs
run: make cs

- name: PHP-CS-Fixer
run: php-cs-fixer fix app config lang routes tests --dry-run --diff --allow-risky=yes --config=.php-cs-fixer.php
run: make cs-fix-dry

- name: PHPMD
run: phpmd app text phpmd.xml
run: make md

- name: PHPCPD
run: phpcpd app
- name: Install NPM
run: make node_modules

- name: Check Assets
run: npm run check
- name: Validate Assets
run: make validate-fe

security-check:
name: Security Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check Composer Packages
uses: symfonycorp/security-checker-action@v4
uses: symfonycorp/security-checker-action@v5

- name: Check NPM Packages
run: npm audit --omit=dev
run: make audit

tests:
name: Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Up PHP and Tools
uses: shivammathur/setup-php@master
with:
php-version: "8.1"
extensions: bz2, bcmath, curl, exif, gd, imagick, imap, intl, mysqli, pcntl, pcov, pdo_mysql, soap, xmlrpc, xsl, zip, iconv, pdo
php-version: '8.3'
extensions: bz2, bcmath, curl, exif, gd, imagick, imap, intl, mysqli, pcntl, pcov, pdo_mysql, redis, soap, xmlrpc, xsl, zip, iconv, pdo
tools: composer:v2
coverage: pcov

- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: make vendor

- name: Install NPM
run: npm ci

- name: Setup PHPUnit Environment
run: yes | cp .env.testing.example .env

- name: Build Assets
run: ./buildHook.sh $PWD

- name: Run Tests & Generate Coverage Report
run: ./vendor/bin/phpunit --coverage-clover ./coverage.xml

- name: Check Test Coverage
uses: johanvanhelden/gha-clover-test-coverage-check@v1
with:
percentage: "95"
filename: "coverage.xml"

dusk:
name: Dusk
runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: tests_db
ports:
- 13306:3306

steps:
- uses: actions/checkout@v3

- name: Initialize the Database
run: |
sudo systemctl start mysql
mysql --user="root" --password="root" -e "CREATE DATABASE tests_db character set UTF8mb4 collate utf8mb4_bin;"
- name: Set Up PHP and Tools
uses: shivammathur/setup-php@master
with:
php-version: "8.1"
extensions: bz2, bcmath, curl, exif, gd, imagick, imap, intl, mysqli, pcntl, pcov, pdo_mysql, soap, xmlrpc, xsl, zip, iconv, pdo
tools: composer:v2
coverage: pcov

- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: make node_modules

- name: Build Assets
run: ./buildHook.sh $PWD

- name: Setup Dusk Environment
run: yes | cp .env.dusk.local.example .env

- name: Set the Chrome Driver
run: php artisan dusk:chrome-driver --detect

- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux &
run: make assets

- name: Start Server
run: php artisan serve --no-reload &

- name: Run Dusk
run: composer test-browser
env:
APP_URL: "http://127.0.0.1:8000"

- name: Upload Dusk Artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: Dusk Artifacts
path: |
./tests/Browser/screenshots
./tests/Browser/console
./storage/logs
- name: Test and Coverage
run: make test-coverage

sentry-release:
name: Sentry Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action == 'merged'))
needs: [code-analysis, code-style, security-check, tests, dusk]
needs: [code-analysis, code-style, security-check, tests]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -197,10 +123,10 @@ jobs:
name: Deploy Staging
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action == 'merged'))
needs: [code-analysis, code-style, security-check, tests, dusk]
needs: [code-analysis, code-style, security-check, tests]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Trigger Forge Staging Webhook
run: |
Expand All @@ -210,10 +136,10 @@ jobs:
name: Deploy Production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action == 'merged'))
needs: [code-analysis, code-style, security-check, tests, dusk]
needs: [code-analysis, code-style, security-check, tests]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Trigger Forge Production Webhook
run: |
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ npm-debug.log
.env
.env.backup
.env.testing
.env.dusk.local

# cache
/*.cache

# testing
/public/tests-report
phpunit\.dusk\.xml

Loading

0 comments on commit 99b7ef6

Please sign in to comment.