You've already forked Php-Template
Compare commits
2 Commits
v1.3.0
...
54c656551e
| Author | SHA1 | Date | |
|---|---|---|---|
|
54c656551e
|
|||
|
a7c86343e4
|
@@ -1,5 +1,2 @@
|
|||||||
.idea/
|
|
||||||
.DS_Store
|
|
||||||
vendor/
|
vendor/
|
||||||
.phpunit.cache/
|
.phpunit.cache/
|
||||||
tests/
|
|
||||||
@@ -246,23 +246,10 @@ 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
|
||||||
uses: addnab/docker-run-action@v3
|
run: |
|
||||||
with:
|
docker run --rm \
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
-w ${{ github.workspace }} \
|
||||||
image: siteworxpro/composer
|
siteworxpro/composer \
|
||||||
options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} -w ${{ gitea.workspace }}
|
run tests:unit
|
||||||
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
|
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,3 @@
|
|||||||
.idea/
|
.idea/
|
||||||
.DS_Store
|
|
||||||
vendor/
|
vendor/
|
||||||
.phpunit.cache/
|
.phpunit.cache/
|
||||||
|
|
||||||
tests/reports/
|
|
||||||
5
.gitlab-ci.yml
Normal file
5
.gitlab-ci.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
include:
|
||||||
|
- local: .gitlab/ci/stages.yml
|
||||||
|
- local: .gitlab/ci/tests.yml
|
||||||
|
- local: .gitlab/ci/libraries.yml
|
||||||
|
|
||||||
15
.gitlab/ci/libraries.yml
Normal file
15
.gitlab/ci/libraries.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
3
.gitlab/ci/stages.yml
Normal file
3
.gitlab/ci/stages.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
stages:
|
||||||
|
- libraries
|
||||||
|
- tests
|
||||||
65
.gitlab/ci/tests.yml
Normal file
65
.gitlab/ci/tests.yml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
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
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
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,24 +12,6 @@ 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"
|
||||||
@@ -47,11 +29,6 @@ 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:
|
||||||
@@ -59,11 +36,6 @@ 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,8 +1,5 @@
|
|||||||
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,6 +49,8 @@ class ControllerTest extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestClass extends Controller // phpcs:ignore
|
// @ignore
|
||||||
|
class TestClass extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ abstract class AbstractFacade extends Unit
|
|||||||
sprintf('The facade %s is not properly initialized.', $this->getConcrete())
|
sprintf('The facade %s is not properly initialized.', $this->getConcrete())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ 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