Skip to content

Commit

Permalink
Merge branch 'release/v0.0.6' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
octfx committed Oct 3, 2020
2 parents 104000c + 5a5923f commit 4fd78cf
Show file tree
Hide file tree
Showing 514 changed files with 56,063 additions and 5,590 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.github
node_modules
vendor
resources/assets
bootstrap/cache/*
10 changes: 10 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
APP_NAME=API_CI
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000

DB_CONNECTION=sqlite
DB_DATABASE=db.sqlite

ADMIN_AUTH_USE_STUB=true
32 changes: 32 additions & 0 deletions .github/linters/phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--
~ Copyright (c) 2020
~ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->

<ruleset name="super-linter">
<arg value="s" />

<description>PSR12 - minor customizations</description>
<rule ref="PSR12">
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock" />
<exclude name="Generic.Files.LineEndings.InvalidEOLChar" />
</rule>

<rule ref="PSR2">
<exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" />
</rule>


<rule ref="Generic.Files.LineLength">
<properties>
<property phpcs-only="true" name="lineLimit" value="140"/>
<property phpcbf-only="true" name="lineLimit" value="120"/>
</properties>
</rule>
</ruleset>
61 changes: 61 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
###########################
###########################
## Linter GitHub Actions ##
###########################
###########################
name: Lint Code Base

#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
push:
branches: [ develop, feature/** ]
pull_request:
branches: [ develop, master ]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v3
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: develop
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_INCLUDE: .*app/.*
OUTPUT_FORMAT: tap
VALIDATE_CSS: false
VALIDATE_JAVASCRIPT_ES: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_HTML: false

VALIDATE_PHP_BUILTIN: false # Not php 7.4 ready
VALIDATE_PHP_PHPSTAN: false
VALIDATE_PHP_PSALM: false
116 changes: 116 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Laravel Tests
on:
push:
branches: [ master, develop, feature/** ]
pull_request:
branches: [ master ]
jobs:
laravel-test-sqlite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get Composer Cache Directory 2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
id: actions-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache PHP dependencies
uses: actions/cache@v2
id: vendor-cache
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
- name: Setup env file
run: cp .env.ci .env
- name: test ls
run: ls -lao
- name: Composer install
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist
- name: Setup keys
run: php artisan key:generate
- name: Fix perms for dirs
run: chmod -R 777 storage bootstrap/cache
- name: Migrate database
env:
DB_CONNECTION: 'sqlite'
DB_DATABASE: 'db.sqlite'
run: touch database/db.sqlite; php artisan migrate
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: 'sqlite'
DB_DATABASE: 'db.sqlite'
run: vendor/phpunit/phpunit/phpunit
laravel-test-sql:
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.DB_PASSWORD }}
MYSQL_DATABASE: scw__api
MYSQL_USER: scw__api
MYSQL_PASSWORD: ${{ secrets.DB_PASSWORD }}
ports:
- 33306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v2

- name: Get Composer Cache Directory 2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
id: actions-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache PHP dependencies
uses: actions/cache@v2
id: vendor-cache
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
- name: Setup env file
run: cp .env.ci .env
- name: test ls
run: ls -lao
- name: Composer install
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist
- name: Setup keys
run: php artisan key:generate
- name: Fix perms for dirs
run: chmod -R 777 storage bootstrap/cache
- name: Migrate database
env:
DB_CONNECTION: 'mysql'
DB_DATABASE: 'scw__api'
DB_PORT: 33306
#DB_HOST: 'mysql'
DB_USERNAME: 'scw__api'
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: touch database/db.sqlite; php artisan migrate
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: 'mysql'
DB_DATABASE: 'scw__api'
DB_PORT: 33306
#DB_HOST: 'mysql'
DB_USERNAME: 'scw__api'
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: vendor/phpunit/phpunit/phpunit
90 changes: 0 additions & 90 deletions .gitlab-ci.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--
~ Copyright (c) 2020
~ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->

<ruleset name="super-linter">
<description>PSR12 - minor customizations</description>
<rule ref="PSR12">
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock" />
<exclude name="Generic.Files.LineEndings.InvalidEOLChar" />
</rule>

<rule ref="PSR2">
<exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" />
</rule>


<rule ref="Generic.Files.LineLength">
<properties>
<property phpcs-only="true" name="lineLimit" value="140"/>
<property phpcbf-only="true" name="lineLimit" value="120"/>
</properties>
</rule>
</ruleset>
Loading

0 comments on commit 4fd78cf

Please sign in to comment.