-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # README.md # composer.lock # migrations/db-config.php
- Loading branch information
Showing
26 changed files
with
253 additions
and
69 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,77 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: [ master, feature/**, bugfix/** ] | ||
pull_request: | ||
branches: [ master ] | ||
env: | ||
COVERAGE: '0' | ||
|
||
jobs: | ||
phpunit: | ||
name: PHPUnit (PHP ${{ matrix.php }}) | ||
runs-on: ubuntu-latest | ||
services: | ||
mysql: | ||
image: bitnami/mysql:5.7 | ||
env: | ||
ALLOW_EMPTY_PASSWORD: false | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: cafe-db | ||
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password | ||
ports: | ||
- 3306/tcp | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval=10s | ||
--health-timeout=5s | ||
--health-retries=3 | ||
strategy: | ||
matrix: | ||
php: | ||
- '7.4' | ||
#- '8.0' | ||
include: | ||
- php: '7.4' | ||
coverage: xdebug | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: setup-php | ||
id: setup-php | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: intl, bcmath, curl, openssl, mbstring | ||
ini-values: memory_limit=-1 | ||
tools: composer | ||
coverage: ${{ matrix.coverage }} | ||
- name: Install Composer dependencies | ||
run: composer install --no-interaction --no-progress --ansi | ||
- name: Enable code coverage for PHP-7.4 | ||
if: ${{ matrix.php == '7.4' }} | ||
run: echo "COVERAGE=1" >> $GITHUB_ENV | ||
- name: Run Migration | ||
run: vendor/bin/doctrine-migrations migrations:migrate --configuration migrations/migrations-config.php --db-configuration migrations/db-config.php --no-interaction --ansi || echo "No migrations found or migration failed" | ||
env: | ||
CAFE_DATABASE_URL: mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cafe-db?serverVersion=5.7&charset=UTF8 | ||
- name: Run PHPUnit tests | ||
run: | | ||
mkdir -p reports/phpunit | ||
if [ "$COVERAGE" = '1' ]; then | ||
vendor/bin/phpunit --coverage-clover reports/phpunit/clover.xml --log-junit reports/phpunit/junit.xml --colors=always | ||
else | ||
vendor/bin/phpunit --colors=always | ||
fi | ||
env: | ||
CAFE_DATABASE_URL: mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cafe-db?serverVersion=5.7&charset=UTF8 | ||
- name: Upload coverage results to Codecov | ||
if: matrix.coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
directory: ./reports/phpunit/ | ||
name: phpunit-php${{ matrix.php }} | ||
flags: phpunit | ||
fail_ci_if_error: true | ||
continue-on-error: 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,77 @@ | ||
SHELL=/bin/bash | ||
|
||
ifndef PHP_DOCKER_COMMAND | ||
PHP_DOCKER_COMMAND=docker-compose exec php-fpm | ||
endif | ||
|
||
# Mute all `make` specific output. Comment this out to get some debug information. | ||
.SILENT: | ||
|
||
.PHONY: help | ||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
|
||
|
||
.PHONY: up | ||
up: ## start docker containers | ||
- docker-compose up -d | ||
|
||
.PHONY: down | ||
down: ## stop docker containers | ||
- docker-compose down -v | ||
|
||
.PHONY: status | ||
status: ## List containers | ||
- docker-compose ps | ||
|
||
|
||
|
||
.PHONY: install-dependencies | ||
install-dependencies: ## Run composer install | ||
- ${PHP_DOCKER_COMMAND} composer install | ||
|
||
.PHONY: migrations-run | ||
migrations-run: ## Run database migrations | ||
- ${PHP_DOCKER_COMMAND} vendor/bin/doctrine-migrations migrations:migrate --configuration migrations/migrations-config.php --db-configuration migrations/db-config.php --no-interaction --ansi | ||
|
||
.PHONY: prune | ||
prune: ## Delete cache and log files | ||
- ${MAKE} prune-cache | ||
- ${MAKE} prune-logs | ||
|
||
.PHONY: prune-all | ||
prune-all: ## Delete vendor folder, cache and log files | ||
- sudo rm -fR vendor/* | ||
- ${MAKE} prune-cache | ||
- ${MAKE} prune-logs | ||
|
||
|
||
.PHONY: prune-cache | ||
prune-cache: | ||
- ${PHP_DOCKER_COMMAND} rm -fR var/cache/* | ||
|
||
.PHONY: prune-logs | ||
prune-logs: | ||
- ${PHP_DOCKER_COMMAND} rm -fR var/log/* | ||
|
||
|
||
|
||
.PHONY: test | ||
test: ## Run phpunit | ||
- ${PHP_DOCKER_COMMAND} vendor/bin/phpunit | ||
|
||
# TODO STATIC ANALYSE | ||
#.PHONY: analyse | ||
#analyse: ## Run static analyse | ||
# - ${PHP_DOCKER_COMMAND} ...dev tool command | ||
|
||
# TODO CODE STYLE CHECK | ||
#.PHONY: cs | ||
#cs: ## Check code style | ||
# - ${PHP_DOCKER_COMMAND} ...dev tool command --dry-run | ||
|
||
# TODO CODE STYLE FIX | ||
#.PHONY: cs-fix | ||
#cs-fix: ## Fix code style | ||
# - ${PHP_DOCKER_COMMAND} ...dev tool command |
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 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 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 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
|
||
return [ | ||
//todo use dotenv | ||
'url' => 'mysql://cafe-user:cafe-pass@cafe-mysql/cafe-db?charset=UTF8' | ||
'url' => getenv('CAFE_DATABASE_URL') | ||
]; |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
.container-fluid { | ||
margin-top: 15px; | ||
} | ||
|
||
.open-table { | ||
border: 1px solid black; | ||
text-align: center; | ||
font-size: xxx-large; | ||
margin-bottom: 30px; | ||
border-radius: 10px; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 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 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 |
---|---|---|
@@ -1,5 +1,17 @@ | ||
{% extends 'base.html.twig' %} | ||
{% block title %}Cafe application{% endblock %} | ||
{% block title %}Open Tabs{% endblock %} | ||
{% block content %} | ||
dd | ||
<div class="row row-cols-4"> | ||
{% for tableNumber in activeTables.activeTableNumbers() %} | ||
<div class="col"> | ||
<div class="open-table"> | ||
<a href="{{ path('tab_status', {tableNumber : tableNumber}) }}">{{ tableNumber }}</a> | ||
</div> | ||
</div> | ||
{% else %} | ||
<div class="col"> | ||
No open tabs. Please <a href="{{ path('tab_open') }}">open a tab</a> and order. | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endblock %} |
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 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
Oops, something went wrong.