Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Version 2.0 #66

Merged
merged 28 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:vue/vue3-recommended",
"plugin:vue/vue3-essential",
"plugin:vue/vue3-strongly-recommended"
],
rules: {
"no-undef": 0,
"vue/multi-word-component-names": 0,
"vue/no-v-html": 0,
"vue/require-default-prop": 0,
"indent": ["error", 4],
"quotes": ["error", "double"],
}
}
82 changes: 82 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: "Coding Standards"
on: [push]
jobs:
coding-standards:
runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "8.0"
node-version:
- 16

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: "Install Node"
uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node-version }}"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
name: List the state of node modules
continue-on-error: true
run: npm list

- name: "Install locked dependencies with npm"
run: "npm ci --ignore-scripts"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"

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

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: mkdir -p .build/php-cs-fixer

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/cache@v2"
with:
path: "~/.build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

- name: "Run eslint"
run: "npm run eslint"

- name: "Run friendsofphp/php-cs-fixer"
run: "composer php-cs-fixer"

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
30 changes: 0 additions & 30 deletions .github/workflows/js.yml

This file was deleted.

86 changes: 72 additions & 14 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,93 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.0, 7.4]
laravel: [9.*, 8.*]
php: [8.1, 8.0]
laravel: [9.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 9.*
php: 7.4
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
name: List the state of node modules
continue-on-error: true
run: npm list

- name: "Install locked dependencies with npm"
run: |
npm ci --ignore-scripts
cd app
npm ci --ignore-scripts

- name: Build package
run: npm run build

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql
coverage: none

- name: Install dependencies
- name: Prepare demo app
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
cd app
cp .env.example .env
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
npm run production
touch database/database.sqlite
php artisan migrate:fresh --seed
php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`

- name: Start Chrome Driver
run: |
cd app
./vendor/laravel/dusk/bin/chromedriver-linux &

- name: Run Laravel Server
run: |
cd app
php artisan serve &

- name: Execute tests
run: vendor/bin/phpunit
run: |
cd app
php artisan dusk

- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v2
with:
name: screenshots
path: app/tests/Browser/screenshots

- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: console
path: app/tests/Browser/console

- name: Upload Logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs
path: app/storage/logs
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ composer.lock
docs
vendor
coverage
.phpunit.result.cache
.phpunit.result.cache
app/public/css/app.css
app/public/js/app.js
app/public/mix-manifest.json
55 changes: 55 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/php',
__DIR__ . '/app/app',
__DIR__ . '/app/config',
__DIR__ . '/app/database',
__DIR__ . '/app/lang',
__DIR__ . '/app/routes',
__DIR__ . '/app/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@PHP73Migration' => true,
'@PHP74Migration' => true,
'@PHP80Migration' => true,
'@PSR2' => true,
'array_indentation' => true,
'binary_operator_spaces' => ['default' => 'align_single_space_minimal'],
'blank_line_before_statement' => ['statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try']],
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'concat_space' => ['spacing' => 'one'],
'increment_style' => ['style' => 'post'],
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => true],
'method_chaining_indentation' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'no_extra_blank_lines' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'not_operator_with_successor_space' => false,
'ordered_imports' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'return_type_declaration' => ['space_before' => 'none'],
'semicolon_after_instruction' => false,
'simple_to_complex_string_variable' => true,
'strict_comparison' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'yoda_style' => false,
])
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(false);
Loading