Skip to content

Commit

Permalink
Ativa na pipeline de testes verificação com psalm e cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
lpirola committed Sep 6, 2024
1 parent 867d391 commit cd06a74
Show file tree
Hide file tree
Showing 17 changed files with 304 additions and 2,274 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/ci-cypress.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/ci.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/main.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/rc.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/test.yml

This file was deleted.

96 changes: 44 additions & 52 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,44 @@ on:
- develop

jobs:
CODE_STYLE:
name: CODE STYLE
CODE_STYLE_FIXER:
name: CODE STYLE CS FIXER
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run PHP-CS-Fixer
uses: erkenes/php-cs-fixer-action@main
with:
args: '--dry-run --diff -vvv'

PHP_UNIT:
name: PHP UNIT
CODE_STYLE_PSALM:
name: CODE STYLE PSALM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run Psalm
uses: docker://ghcr.io/psalm/psalm-github-actions
with:
composer_require_dev: true
composer_ignore_platform_reqs: true
security_analysis: true
CODE_TESTS:
name: CODE TESTS
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- name: Baixando codigo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Add default env values
- name: Configuração de valores padrões
run: |
cp .env.sample .env
cp .env.sample app
- uses: hoverkraft-tech/[email protected]
with:
Expand All @@ -40,36 +54,36 @@ jobs:
up-flags: "-d --wait"
down-flags: "-v"

- name: Run migrations
- name: Atualização da estrutura do banco de dados
run: |
docker compose exec web mkdir var/logs/
docker compose exec web mkdir var/private-files/
docker compose exec web chmod 777 var/logs/
docker compose exec web chmod 777 var/private-files/
docker compose exec web chmod 777 var/sessions/
docker compose exec web chmod 777 var/DoctrineProxies/
docker compose exec web php src/tools/apply-updates.php
docker compose exec web php app/bin/doctrine migrations:migrate --no-interaction --all-or-nothing
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web composer install
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web mkdir var/logs/
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web mkdir var/private-files/
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web chmod 777 var/logs/
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web chmod 777 var/private-files/
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web chmod 777 var/sessions/
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web chmod 777 var/DoctrineProxies/
docker compose -f docker-compose.yaml -f docker-compose.dev.yaml exec web ./scripts/db-update.sh
env:
APP_MODE: development

- name: Run Phpunit tests
- name: Testes Unitários com PhpUnit
run: |
docker compose exec web ./vendor/bin/phpunit -c phpunit.xml
docker compose exec web ./vendor/bin/phpunit -c phpunit.xml --coverage-clover ./coverage.xml
- name: Cypress run
- name: Testes de integração com Cypress
uses: cypress-io/github-action@v6
with:
# config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}'
# start: pnpm run cypress:run
config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}'
wait-on: "http://localhost:4242"
wait-on-timeout: 120
browser: chrome
record: true
parallel: true
group: "UI - Chrome - Mobile"
#spec: src/cypress/*
#config-file: src/cypress/cypress.config.js
working-directory: src
# config-file: src/cypress.config.js
# start: npm start
browser: chrome
env:
# CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand All @@ -83,27 +97,6 @@ jobs:
name: screenshots
if-no-files-found: error
path: src/cypress/screenshots

# - name: "UI Tests - Chrome - Mobile"
# uses: cypress-io/github-action@v6
# with:
# # config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}'
# # start: pnpm run cypress:run
# wait-on: "http://web"
# wait-on-timeout: 120
# browser: chrome
# record: true
# parallel: true
# group: "UI - Chrome - Mobile"
# spec: src/cypress/*
# config-file: src/cypress/cypress.config.js
# env:
# # CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
# # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# # Recommended: pass the GitHub token lets this action correctly
# # determine the unique run id necessary to re-run the checks
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Install composer and dependencies
# uses: php-actions/composer@v6
# with:
Expand All @@ -118,12 +111,11 @@ jobs:
# php_version: 8.2
# configuration: phpunit.xml
# php_extensions: pdo_pgsql zip intl gd mbstring curl xml
# args: tests --coverage-clover ./coverage.xml

# - name: Upload to Codecov
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODE_COV_TOKEN }}
# files: ./coverage.xml
# verbose: true
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODE_COV_TOKEN }}
files: ./coverage.xml
verbose: true

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ node_modules
.env
mix-manifest.json
.php-cs-fixer.cache
.phpunit.cache
coverage.xml
2 changes: 1 addition & 1 deletion .phpactor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "/phpactor.schema.json",
"language_server_psalm.enabled": false,
"language_server_psalm.enabled": enabled,
"language_server_php_cs_fixer.enabled": true,
"php_code_sniffer.enabled": true
}
Loading

0 comments on commit cd06a74

Please sign in to comment.