Skip to content

Commit

Permalink
Initial release of code project
Browse files Browse the repository at this point in the history
Signed-off-by: William José Moreno Reyes <williamjmorenor@gmail.com>
  • Loading branch information
williamjmorenor committed Apr 17, 2024
0 parents commit f855213
Show file tree
Hide file tree
Showing 215 changed files with 52,534 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
source = cacao_accounting
31 changes: 31 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Control de Versiones
.git
.github
.gitignore
.git-blame-ignore-revs
.vscode
.idea


# Documentacion
mkdocs.yml
docs

# No necesitamos docker files en el contenedor
Dockerfile
docker-compose.yml

# Archivos para colaboradores
.theia
.coveragerc
.pylintrc
codecov.yml
venv
tests
development.txt
requirements-databases.txt
*.yml
*.db
.mypy.ini
.gitpod.yml
.gitpod.sh
20 changes: 20 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# refactor: Mejora nombre de variables
dc9966430838d59d140d83db06d1c00a60393766

# style: Correcciones de estilo
45b6bd323c13d7b9576bb01616601149b6c68c5b

# style: Correciones de estilo
921238778c7629bfb421ae31b6cd80e646eb687b

# tyle: Correciones de estilo
04221e06b7652291c1299d5661c54e6ba278f0d3

# style: Correciones de estilo
76f1a8f5cece095db673ff9428186dfdf05aae1f

#style: Correciones de estilo
729a2939f3153765e0d11453a87186282519e736

# refactor: Mejora nombres de variables
15548523ecdbc6fec20a51c1b43b80a2353f3467
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: cacao_accounting
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
62 changes: 62 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
schedule:
- cron: '20 21 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
49 changes: 49 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Contenedores

on:
push:
branches: [ main,]
pull_request:
branches: [ main,]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Crear Contedor
run: |
sudo podman pull registry.access.redhat.com/ubi8/ubi-minimal
sudo buildah bud -t cacao-image .
- name: Ejecutar Contenedor
run: |
# Mysql
sudo podman pod create --name cacao-mysql -p 8888:8080
sudo podman volume create cacao-database-mysql
sudo podman run --pod cacao-mysql --name cacaodb-mysql --volume cacao-database-mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=cacaodb -e MYSQL_DATABASE=cacaodb -e MYSQL_USER=cacaodb -e MYSQL_PASSWORD=cacaodb -d mysql:8
sudo podman run --pod cacao-mysql --init --name cacao-accounting-mysql -e CACAO_ACCOUNTING=True -e CACAO_KEY=nsjksldknsdlkdsljdn -e CACAO_DB=mysql+pymysql://cacaodb:cacaodb@localhost:3306/cacaodb -d localhost/cacao-image
# Postgresql
sudo podman pod create --name cacao-postgresl -p 9999:8080
sudo podman volume create cacao-database-postgresql
sudo podman run --pod cacao-postgresl --name cacaodb-pg --volume cacao-database-postgresql:/var/lib/postgresql/data -e POSTGRES_DB=cacaodb -e POSTGRES_USER=cacaodb -e POSTGRES_PASSWORD=cacaodb -d postgres:13
sudo podman run --pod cacao-postgresl --init --name cacao-accounting-postgresl -e CACAO_ACCOUNTING=True -e CACAO_KEY=nsjksldknsdlkdsljdn -e CACAO_USER=cacao -e CACAO_PWD=cacao -e CACAO_DB=postgresql+pg8000://cacaodb:cacaodb@localhost:5432/cacaodb -d localhost/cacao-image
- name: Probar Contenedor
run: |
sudo podman pod stop cacao-mysql cacao-postgresl
sudo podman pod start cacao-mysql cacao-postgresl
sleep 35
sudo podman container ls
echo ""
echo ""
echo "Probando acceso a contenedor cacao-mysql"
curl http://127.0.0.1:8888/info
curl http://127.0.0.1:8888/app
curl http://127.0.0.1:8888/hola
curl http://127.0.0.1:8888/login
echo ""
echo ""
echo "Probando acceso a contenedor cacao-postgresl"
curl http://127.0.0.1:9999/info
curl http://127.0.0.1:9999/app
curl http://127.0.0.1:9999/hola
curl http://127.0.0.1:9999/login
101 changes: 101 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
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:
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
mariadb:
image: mariadb
env:
MARIADB_ALLOW_EMPTY_PASSWORD: yes
MARIADB_DATABASE: cacao
MARIADB_USER: cacao
MARIADB_PASSWORD: cacao
ports:
- 3307:3306
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.7, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
python -m pip install flake8
flake8 cacao_accounting
- name: Verificando tipos
run: |
python -m pip install mypy
mypy cacao_accounting/
- name: Analysing the code with pylint
run: |
python -m pip install pylint
# Ejecutamos pylint antes de instalar las dependencias, silenciamos ese error
# en el servicio de CI pero en la configuración local.
pylint cacao_accounting --disable=import-error --fail-under=9.5
- name: Check Test
run: flake8 tests
- name: HTML Lint
run: |
# curlylint cacao_accounting/templates
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -r development.txt
python setup.py develop
python -m pip install git+https://github.com/maxcountryman/flask-login.git
- name: Proyecto distribuible
run: |
python -m build
twine check dist/*
- name: Test with pytest
run: |
sleep 5
export CACAO_TEST=True
export CACAO_TEST_SLOW=True
python -m pytest -v --exitfirst --cov=cacao_accounting
# CACAO_TEST=True SQLALCHEMY_WARN_20=1 python -W always::DeprecationWarning -m pytest -v --exitfirst --cov=cacao_accounting
# - name: Documentacion
# run: mkdocs build
- name: Codecov
uses: codecov/codecov-action@v1

0 comments on commit f855213

Please sign in to comment.