-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.69 KB
/
pipeline-ci.yaml
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
# Nome do workflow
name: CI/CD Workflow
# Definir quando o workflow será executado
on:
push:
branches:
- main # Executa o workflow ao push na branch 'main'
- ajustar-workflow
pull_request:
branches:
- main # Executa o workflow ao abrir um PR na branch 'main'
# Definindo os jobs
jobs:
# Job para rodar os testes
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
#- name: Set up Docker
# uses: docker/setup-buildx-action@v2
#- name: Install Docker Compose
# run: |
# sudo apt-get update
# sudo apt-get install -y docker-compose
#- name: Set up Docker Compose
# run: |
# docker-compose -f API/docker-compose.yml up -d --build
#- name: Run migrations
# run: |
# docker-compose -f API/docker-compose.yml exec web python manage.py migrate
#- name: Run tests with coverage
# run: |
# docker-compose -f API/docker-compose.yml exec web coverage run --source='.' manage.py test
#- name: Generate coverage report
# run: |
# docker-compose -f API/docker-compose.yml exec web coverage xml
# # Gera o relatório em XML, necessário para o Codecov
#- name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# files: ./web/coverage.xml # Caminho do relatório XML gerado
# token: ${{ secrets.CODECOV_TOKEN }} # O token Codecov é armazenado nos secrets do GitHub
#flags: unittests
#name: Django Tests
#- name: Tear down Docker Compose
# if: always()
# run: |
# docker-compose down