-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor/model-database
- Loading branch information
Showing
73 changed files
with
855 additions
and
360 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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
APP_NAME=Urban Tree 5.0 | ||
DB_HOST=database | ||
|
||
ENV=development | ||
|
||
#* Database | ||
|
||
DB_NAME=urbantree | ||
DB_USER=root | ||
DB_PASS=J0HMXAJ6XE | ||
# If you are using docker-compose, you can ignore the following variables | ||
DB_HOST=database | ||
DB_PORT=3306 |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 🧪 Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
urbantree: | ||
name: 🧪 UrbanTree | ||
runs-on: ubuntu-latest | ||
steps: | ||
# https://github.com/actions/checkout/tree/11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
# https://github.com/actions/cache/tree/6849a6489940f00c2f30c0fb92c6274307ccb58a | ||
- name: 📦 Cache Composer dependencies | ||
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a | ||
with: | ||
path: /tmp/composer-cache | ||
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | ||
|
||
# https://github.com/shivammathur/setup-php/tree/c541c155eee45413f5b09a52248675b1a2575231 | ||
- name: 🐘 Setup PHP with extensions | ||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 | ||
with: | ||
php-version: 8.4 | ||
coverage: xdebug | ||
extensions: none, ctype, curl, dom, json, libxml, mbstring, pdo, phar, tokenizer, xml, xmlwriter | ||
ini-values: zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On | ||
tools: none | ||
|
||
# https://github.com/php-actions/composer/tree/8a65f0d3c6a1d17ca4800491a40b5756a4c164f3 | ||
- name: 📦 Install Composer dependencies | ||
uses: php-actions/composer@8a65f0d3c6a1d17ca4800491a40b5756a4c164f3 | ||
|
||
- name: 🧪 Run PHPUnit tests with coverage | ||
shell: bash | ||
run: ./vendor/bin/phpunit --log-junit junit.xml --coverage-clover=coverage.xml | ||
|
||
# https://github.com/codecov/test-results-action/tree/9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820 | ||
- name: 📊 Upload test results to Codecov | ||
if: ${{ !cancelled() }} | ||
uses: codecov/test-results-action@9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# https://github.com/codecov/codecov-action/tree/015f24e6818733317a2da2edd6290ab26238649a | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a | ||
with: | ||
verbose: true | ||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 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,20 +1,8 @@ | ||
--* Photos | ||
INSERT INTO photos (name, path) VALUES | ||
('Foto Usuario 1', '/uploads/users/photo1.jpg'), | ||
('Foto Usuario 2', '/uploads/users/photo2.jpg'), | ||
('Foto Máquina 1', '/uploads/machines/photo1.jpg'); | ||
|
||
--* Roles | ||
INSERT INTO roles (name) VALUES | ||
('Administrador'), | ||
('Gerente'), | ||
('Trabajador'); | ||
|
||
--* Users | ||
INSERT INTO users (company, name, surname, dni, password, email, role_id, photo_id) VALUES | ||
('Projar', 'Carlos', 'García', '12345678A', 'hashedpassword1', '[email protected]', 1, 1), | ||
('Projar', 'Ana', 'Martínez', '23456789B', 'hashedpassword2', '[email protected]', 2, 2), | ||
('Projar', 'José', 'Rodríguez', '34567890C', 'hashedpassword3', '[email protected]', 3, NULL); | ||
INSERT INTO users (company, name, surname, dni, password, email, role) VALUES | ||
('TechCorp', 'Carlos', 'García', '12345678A', 'hashedpassword1', '[email protected]', 1), | ||
('InnovaTech', 'Ana', 'Martínez', '23456789B', 'hashedpassword2', '[email protected]', 1), | ||
('DesignWorks', 'José', 'Rodríguez', '34567890C', 'hashedpassword3', '[email protected]', 2); | ||
|
||
--* Contracts | ||
INSERT INTO contracts (name, start_date, end_date, invoice_proposed, invoice_agreed, invoice_paid) VALUES | ||
|
@@ -23,10 +11,10 @@ INSERT INTO contracts (name, start_date, end_date, invoice_proposed, invoice_agr | |
('Ayuntamiento de Carlet', '2021-01-01', '2021-12-31', 3000.00, 2700.00, 2700.00); | ||
|
||
--* Machines | ||
INSERT INTO machines (name, max_basket_size, photo_id) VALUES | ||
('Cesta elevadora', 200.00, 3), | ||
('Plataforma elevadora', 300.00, NULL), | ||
('Tijera elevadora', 400.00, NULL); | ||
INSERT INTO machines (name, max_basket_size) VALUES | ||
('Cesta elevadora', 200.00), | ||
('Plataforma elevadora', 300.00), | ||
('Tijera elevadora', 400.00); | ||
|
||
--* Element Types | ||
INSERT INTO element_types (name, description) VALUES | ||
|
@@ -65,10 +53,10 @@ INSERT INTO elements (element_type_id, contract_id, zone_id, point_id, tree_type | |
(3, 3, 3, 3, NULL); | ||
|
||
--* Incidences | ||
INSERT INTO incidences (element_id, name, description, photo_id) VALUES | ||
(1, 'Rama caída', 'Rama caída en el suelo', NULL), | ||
(2, 'Banco roto', 'Banco roto en el parque', NULL), | ||
(3, 'Fuente sin agua', 'Fuente sin agua en el parque', NULL); | ||
INSERT INTO incidences (element_id, name, description) VALUES | ||
(1, 'Rama caída', 'Rama caída en el suelo'), | ||
(2, 'Banco roto', 'Banco roto en el parque'), | ||
(3, 'Fuente sin agua', 'Fuente sin agua en el parque'); | ||
|
||
--* Work Orders | ||
INSERT INTO work_orders (contract_id) VALUES | ||
|
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.