-
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.
- Loading branch information
1 parent
313d096
commit 2720235
Showing
5 changed files
with
130 additions
and
57 deletions.
There are no files selected for viewing
File renamed without changes.
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,16 +1,18 @@ | ||
name: Testes QA-Solar - Main | ||
name: Testes QA-Solar - CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- feat/adiciona-ci-cd-no-projeto | ||
pull_request: | ||
branches: | ||
- main | ||
- feat/adiciona-ci-cd-no-projeto | ||
|
||
jobs: | ||
setup-environment: | ||
name: Configurar Ambiente (PostgreSQL, Backend e Frontend) | ||
cypress-tests: | ||
name: Cypress Testes QA-Solar | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
|
@@ -35,9 +37,9 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Instalar as dependências do Monorepo | ||
run: yarn | ||
run: yarn | ||
|
||
- name: Iniciar backend | ||
run: | | ||
|
@@ -53,12 +55,7 @@ jobs: | |
cd frontend | ||
nohup yarn serve > frontend.log 2>&1 & | ||
cypress-tests: | ||
name: Executar Testes Cypress | ||
needs: setup-environment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Executar testes Cypress | ||
- name: Executar os testes | ||
run: | | ||
cd test/cypress | ||
yarn cy:run | ||
|
@@ -68,43 +65,122 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
name: cypress-artifacts | ||
path: test/cypress/tests/e2e/misc/screenshots | ||
path: tests/e2e/misc/screenshots | ||
|
||
playwright-tests: | ||
name: Executar Testes Playwright | ||
needs: setup-environment | ||
name: Playwright Testes QA-Solar | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: tests_base | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout do repositório | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configurar node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Instalar as dependências do Monorepo | ||
run: yarn | ||
|
||
- name: Iniciar backend | ||
run: | | ||
cd backend | ||
yarn prisma migrate dev | ||
yarn prisma:seed | ||
nohup yarn api > backend.log 2>&1 & | ||
env: | ||
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/tests_base?schema=public" | ||
|
||
- name: Configurar e iniciar frontend | ||
run: | | ||
cd frontend | ||
nohup yarn serve > frontend.log 2>&1 & | ||
- name: Executar testes Playwright | ||
run: | | ||
cd test/playwright | ||
yarn play:run | ||
- name: Salvar artefatos do Playwright | ||
if: ${{ failure() }} | ||
- name: Upload de testes falhados | ||
uses: actions/[email protected] | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report | ||
path: test/playwright/playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
|
||
robot-framework-tests: | ||
name: Executar Testes Robot Framework | ||
needs: setup-environment | ||
name: Robot Framework Testes QA-Solar | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: tests_base | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout do repositório | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configurar Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
check-latest: true | ||
|
||
- name: Configurar node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Instalar as dependências do Monorepo | ||
run: yarn | ||
|
||
- name: Iniciar backend | ||
run: | | ||
cd backend | ||
yarn prisma migrate dev | ||
yarn prisma:seed | ||
nohup yarn api > backend.log 2>&1 & | ||
env: | ||
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/tests_base?schema=public" | ||
|
||
- name: Configurar e iniciar frontend | ||
run: | | ||
cd frontend | ||
nohup yarn serve > frontend.log 2>&1 & | ||
- name: Instalar dependências do sistema para Robot Framework | ||
run: chmod +x .github/scripts/chrome.sh && .github/scripts/chrome.sh | ||
|
||
- name: Criar ambiente virtual para Python | ||
run: python -m venv venv | ||
- name: Cria ambiente virtual do Python | ||
run: python3.10 -m venv venv | ||
|
||
- name: Instalar dependências do Robot Framework | ||
- name: Instalar dependências | ||
run: | | ||
cd test/robot | ||
source venv/bin/activate | ||
|
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