forked from mapasculturais/mapasculturais
-
Notifications
You must be signed in to change notification settings - Fork 6
132 lines (121 loc) · 4.36 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Testing
on:
pull_request:
branches:
- develop
jobs:
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'
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: Baixando codigo
uses: actions/checkout@v4
with:
submodules: recursive
# See https://github.com/pnpm/action-setup
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
# See https://github.com/actions/setup-node
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
# cache-dependency-path: ./pnpm-lock.yaml
- run: pnpm i
- run: pnpm run build
- name: Configuração de valores padrões
run: |
cp .env.sample .env
- uses: hoverkraft-tech/[email protected]
with:
compose-file: |
docker-compose.yaml
docker-compose.dev.yaml
services: "web"
up-flags: "-d --wait"
down-flags: "-v"
- name: Atualização da estrutura do banco de dados
run: |
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: Testes Unitários com PhpUnit
run: |
docker compose exec web ./vendor/bin/phpunit -c phpunit.xml --coverage-clover ./coverage.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true
- name: Testes de integração com Cypress
uses: cypress-io/github-action@v6
with:
config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}'
wait-on: "http://localhost:4242"
wait-on-timeout: 120
browser: chrome
# record: false
# parallel: true
# group: "UI - Chrome - Mobile"
config-file: 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: Save build folder
uses: actions/upload-artifact@v4
with:
name: screenshots
if-no-files-found: error
path: src/cypress/screenshots
# - name: Install composer and dependencies
# uses: php-actions/composer@v6
# with:
# php_extensions: pdo_pgsql zip intl gd mbstring curl xml
# - name: PHPUnit Tests Mapas
# uses: php-actions/phpunit@v3
# env:
# XDEBUG_MODE: coverage
# with:
# version: 10.5
# php_version: 8.2
# configuration: phpunit.xml
# php_extensions: pdo_pgsql zip intl gd mbstring curl xml