You've already forked Php-Template
Compare commits
3 Commits
54c656551e
...
v1.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
68614958a9
|
|||
|
413145f479
|
|||
|
d2bd9d2d1b
|
@@ -1,2 +1,5 @@
|
|||||||
|
.idea/
|
||||||
|
.DS_Store
|
||||||
vendor/
|
vendor/
|
||||||
.phpunit.cache/
|
.phpunit.cache/
|
||||||
|
tests/
|
||||||
@@ -246,10 +246,23 @@ jobs:
|
|||||||
siteworxpro/composer \
|
siteworxpro/composer \
|
||||||
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
- name: Run Unit Tests
|
- name: 🧪 ✅ Run Unit Tests
|
||||||
run: |
|
uses: addnab/docker-run-action@v3
|
||||||
docker run --rm \
|
with:
|
||||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
-w ${{ github.workspace }} \
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
siteworxpro/composer \
|
image: siteworxpro/composer
|
||||||
run tests:unit
|
options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} -w ${{ gitea.workspace }}
|
||||||
|
run: |
|
||||||
|
bin/pcov.sh
|
||||||
|
composer run tests:unit:coverage
|
||||||
|
|
||||||
|
# - name: 📦 Publish Build Artifacts
|
||||||
|
# env:
|
||||||
|
# NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||||
|
# uses: christopherhx/gitea-upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} -w ${{ gitea.workspace }}
|
||||||
|
# name: junit-coverage.xml
|
||||||
|
# path: tests/reports/junit.xml
|
||||||
|
# retention-days: 1
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
.DS_Store
|
||||||
vendor/
|
vendor/
|
||||||
.phpunit.cache/
|
.phpunit.cache/
|
||||||
|
|
||||||
|
tests/reports/
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
include:
|
|
||||||
- local: .gitlab/ci/stages.yml
|
|
||||||
- local: .gitlab/ci/tests.yml
|
|
||||||
- local: .gitlab/ci/libraries.yml
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
Install Composer Libraries:
|
|
||||||
stage: libraries
|
|
||||||
image: siteworxpro/composer:latest
|
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_TAG'
|
|
||||||
when: never
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
||||||
when: always
|
|
||||||
- when: never
|
|
||||||
script:
|
|
||||||
- composer install --ignore-platform-reqs
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- vendor/
|
|
||||||
expire_in: 1 hour
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
stages:
|
|
||||||
- libraries
|
|
||||||
- tests
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
Unit Tests:
|
|
||||||
stage: tests
|
|
||||||
needs:
|
|
||||||
- Install Composer Libraries
|
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_TAG'
|
|
||||||
when: never
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
||||||
when: always
|
|
||||||
- when: never
|
|
||||||
image: siteworxpro/composer
|
|
||||||
before_script: |
|
|
||||||
bin/pcov.sh
|
|
||||||
script: |
|
|
||||||
echo "Running unit tests..."
|
|
||||||
composer run tests:unit:coverage
|
|
||||||
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 day
|
|
||||||
reports:
|
|
||||||
junit: tests/reports/junit.xml
|
|
||||||
paths:
|
|
||||||
- tests/reports/
|
|
||||||
|
|
||||||
Run License Check:
|
|
||||||
stage: tests
|
|
||||||
needs:
|
|
||||||
- Install Composer Libraries
|
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_TAG'
|
|
||||||
when: never
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
||||||
when: on_success
|
|
||||||
- when: never
|
|
||||||
image: siteworxpro/composer
|
|
||||||
script:
|
|
||||||
- composer run tests:license
|
|
||||||
|
|
||||||
Run Code Lint:
|
|
||||||
stage: tests
|
|
||||||
needs:
|
|
||||||
- Install Composer Libraries
|
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_TAG'
|
|
||||||
when: never
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
||||||
when: on_success
|
|
||||||
- when: never
|
|
||||||
image: siteworxpro/composer
|
|
||||||
script:
|
|
||||||
- composer run tests:lint
|
|
||||||
|
|
||||||
Run Code Sniffer:
|
|
||||||
stage: tests
|
|
||||||
needs:
|
|
||||||
- Install Composer Libraries
|
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_TAG'
|
|
||||||
when: never
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
||||||
when: on_success
|
|
||||||
- when: never
|
|
||||||
image: siteworxpro/composer
|
|
||||||
script:
|
|
||||||
- composer run tests:phpstan
|
|
||||||
4
bin/migrate.sh
Executable file
4
bin/migrate.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
eval #!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
migrate -path /app/db/migrations -database "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOST:$DB_PORT/$DB_DATABASE?sslmode=disable" up
|
||||||
@@ -12,6 +12,24 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
PHP_IDE_CONFIG: serverName=localhost
|
PHP_IDE_CONFIG: serverName=localhost
|
||||||
|
|
||||||
|
migration-container:
|
||||||
|
volumes:
|
||||||
|
- ./db/migrations:/app/db/migrations
|
||||||
|
- ./bin:/app/bin
|
||||||
|
image: siteworxpro/migrate:v4.18.3
|
||||||
|
working_dir: /app
|
||||||
|
# entrypoint: "/bin/sh -c 'while true; do sleep 30; done;'"
|
||||||
|
entrypoint: /bin/sh -c '/app/bin/migrate.sh'
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
environment:
|
||||||
|
DB_USERNAME: ${DB_USERNAME:-siteworxpro}
|
||||||
|
DB_PASSWORD: ${DB_PASSWORD:-password}
|
||||||
|
DB_DATABASE: ${DB_DATABASE:-siteworxpro}
|
||||||
|
DB_HOST: ${DB_HOST-postgres}
|
||||||
|
DB_PORT: ${DB_PORT-5432}
|
||||||
|
|
||||||
dev-runtime:
|
dev-runtime:
|
||||||
ports:
|
ports:
|
||||||
- "9501:9501"
|
- "9501:9501"
|
||||||
@@ -29,6 +47,11 @@ services:
|
|||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "6379:6379"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -36,6 +59,11 @@ services:
|
|||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:latest
|
image: postgres:latest
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-siteworxpro}"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: ${DB_USERNAME:-siteworxpro}
|
POSTGRES_USER: ${DB_USERNAME:-siteworxpro}
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
FROM siteworxpro/migrate:v4.18.3
|
FROM siteworxpro/migrate:v4.18.3
|
||||||
|
|
||||||
ADD db/migrations /app/db/migrations
|
ADD db/migrations /app/db/migrations
|
||||||
|
ADD bin/migrate.sh /app/bin/migrate.sh
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/bin/migrate.sh"]
|
||||||
|
|||||||
@@ -49,8 +49,6 @@ class ControllerTest extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ignore
|
class TestClass extends Controller // phpcs:ignore
|
||||||
class TestClass extends Controller
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ use Siteworxpro\Tests\Unit;
|
|||||||
|
|
||||||
abstract class AbstractServiceProvider extends Unit
|
abstract class AbstractServiceProvider extends Unit
|
||||||
{
|
{
|
||||||
|
|
||||||
abstract protected function getProviderClass(): string;
|
abstract protected function getProviderClass(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user