102 lines (98 loc) · 3.23 KB
/
python-package.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
name: Pruebas de Integración Continua
on:
push:
branches: [ main, development ]
pull_request:
branches: [ main, development ]
jobs:
build:
runs-on: ubuntu-latest
if: |
!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: cacao+SQLSERVER2019
MSSQL_PID: Express
ports:
- 1433:1433
options: >-
--hostname=mssqlserver
--name=mssqlserver
mysql:
image: mysql
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: cacao
MYSQL_USER: cacao
MYSQL_PASSWORD: cacao
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
postgres:
image: postgres:latest
env:
POSTGRES_USER: cacao
POSTGRES_PASSWORD: cacao
POSTGRES_DB: cacao
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9,3.10.0-alpha.5 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -r development.txt
python setup.py develop
- name: Proyecto distribuible
run: |
python -m build
twine check dist/*
- name: Lint with flake8
run: flake8 cacao_accounting
- name: Analysing the code with pylint
run: pylint cacao_accounting
- name: HTML Lint
run: |
# curlylint cacao_accounting/templates
- name: Install pyodbc
run: |
sudo su -c "curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - "
cat /etc/os-release
sudo su -c "curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list"
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17 mssql-tools python3-pip unixodbc-dev python3-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
pip install pyodbc
- name: Create SQL Server db
run: docker exec -t mssqlserver /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "cacao+SQLSERVER2019" -d master -Q 'CREATE DATABASE cacao'
- name: Test with pytest
run: |
sleep 5
python -W ignore tests/nonfree_database.py
python -W ignore tests/opensource_database.py
pytest --disable-warnings --full-trace --exitfirst tests/*.py --cov=cacao_accounting
# - name: Documentacion
# run: mkdocs build
- name: Codecov
uses: codecov/codecov-action@v1