-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from ssi-anik/v2
2.x
- Loading branch information
Showing
55 changed files
with
4,554 additions
and
1,006 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Code sniffer | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
sniff: | ||
name: Sniff codebase | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP Codesniffer | ||
run: composer global require squizlabs/php_codesniffer | ||
|
||
- name: Check against PSR12 standard | ||
run: | | ||
`composer global config bin-dir --absolute --quiet`/phpcs --standard=PSR12 ./src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Run tests and coverage | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
tests: | ||
name: PHP ${{ matrix.php }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 7.2, 7.3, 7.4, 8.0 ] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction --prefer-dist | ||
|
||
- name: Run tests | ||
run: ./vendor/bin/phpunit --testdox --verbose | ||
|
||
coverage: | ||
needs: tests | ||
name: Coverage | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: pcov | ||
php-version: 8.0 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-interaction --prefer-dist | ||
|
||
- name: Run tests for coverage | ||
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml | ||
|
||
- name: Push to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
.idea/ | ||
vendor/ | ||
composer.lock | ||
docker-compose.yml | ||
.phpunit.result.cache | ||
coverage/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: '3.8' | ||
|
||
services: | ||
php: | ||
build: | ||
dockerfile: docker/php.dockerfile | ||
context: . | ||
volumes: | ||
- .:/app | ||
links: | ||
- rabbitmq | ||
|
||
rabbitmq: | ||
build: | ||
dockerfile: docker/rabbitmq.dockerfile | ||
context: . | ||
hostname: rabbitmq-server | ||
ports: | ||
- 5672:5672 | ||
- 15672:15672 | ||
# volumes: | ||
# - ${BACKUP_PATH}/rabbitmq/amqp-package:/var/lib/rabbitmq/mnesia/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
( sleep 10 && \ | ||
rabbitmqctl add_user $RABBITMQ_USER $RABBITMQ_PASSWORD && \ | ||
rabbitmqctl set_user_tags $RABBITMQ_USER administrator && \ | ||
rabbitmqctl set_permissions -p / $RABBITMQ_USER ".*" ".*" ".*" ) & \ | ||
rabbitmq-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM sirajul/php:worker-74-latest | ||
|
||
RUN apt-get update | ||
|
||
RUN docker-php-ext-install bcmath | ||
|
||
RUN docker-php-ext-install sockets | ||
|
||
COPY ./docker/worker.conf /etc/supervisor/conf.d/worker.conf | ||
|
||
RUN mkdir /app | ||
|
||
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM rabbitmq:3.9-management | ||
|
||
RUN apt-get update -y | ||
RUN apt-get install -y nano curl | ||
|
||
# https://stackoverflow.com/a/69217201/2190689 | ||
RUN curl -L https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/3.9.0/rabbitmq_delayed_message_exchange-3.9.0.ez > $RABBITMQ_HOME/plugins/rabbitmq_delayed_message_exchange-3.9.0.ez | ||
RUN chown rabbitmq:rabbitmq $RABBITMQ_HOME/plugins/rabbitmq_delayed_message_exchange-3.9.0.ez | ||
RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange | ||
|
||
# https://stackoverflow.com/a/53403267/2190689 | ||
ENV RABBITMQ_USER user | ||
ENV RABBITMQ_PASSWORD password | ||
|
||
COPY ./docker/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
CMD ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[supervisord] | ||
nodaemon=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
verbose="true"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory>tests/Unit</directory> | ||
</testsuite> | ||
<testsuite name="integration"> | ||
<directory>tests/Integration</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
Oops, something went wrong.