Skip to content

Commit

Permalink
Update 6
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumepot committed Apr 15, 2024
1 parent 6d48557 commit 63b5eff
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 0 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/requirements_pytest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
alembic==1.13.1
aniso8601==9.0.1
annotated-types==0.6.0
anyio==4.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
asttokens==2.4.1
attrs==23.2.0
blinker==1.7.0
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
cloudpickle==3.0.0
comm==0.2.2
contourpy==1.2.0
cryptography==42.0.5
cycler==0.12.1
debugpy==1.8.1
decorator==5.1.1
docker==7.0.0
entrypoints==0.4
et-xmlfile==1.1.0
exceptiongroup==1.2.0
executing==2.0.1
fastapi==0.110.0
Flask==3.0.2
fonttools==4.50.0
gitdb==4.0.11
GitPython==3.1.42
graphene==3.3
graphql-core==3.2.3
graphql-relay==3.2.0
greenlet==3.0.3
gunicorn==21.2.0
h11==0.14.0
httpcore==1.0.4
httpx==0.27.0
idna==3.6
importlib_metadata==7.0.2
iniconfig==2.0.0
ipykernel==6.29.3
ipython==8.22.2
itsdangerous==2.1.2
jedi==0.19.1
Jinja2==3.1.3
joblib==1.3.2
jupyter_client==8.6.1
jupyter_core==5.7.2
#jwt==1.3.1
kiwisolver==1.4.5
Mako==1.3.2
Markdown==3.6
MarkupSafe==2.1.5
matplotlib==3.8.3
matplotlib-inline==0.1.6
mlflow==2.11.1
nest-asyncio==1.6.0
numpy==1.26.4
openpyxl==3.1.2
outcome==1.3.0.post0
packaging==23.2
pandas==2.2.1
parso==0.8.3
passlib==1.7.4
pexpect==4.9.0
pillow==10.2.0
platformdirs==4.2.0
pluggy==1.4.0
prompt-toolkit==3.0.43
protobuf==4.25.3
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
pyarrow==15.0.1
pycparser==2.21
pydantic==2.6.4
pydantic_core==2.16.3
Pygments==2.17.2
PyJWT==2.8.0
pyparsing==3.1.2
PySocks==1.7.1
pytest==8.1.1
python-dateutil==2.9.0.post0
python-multipart==0.0.9
pytz==2024.1
PyYAML==6.0.1
pyzmq==25.1.2
querystring-parser==1.2.4
requests==2.31.0
scikit-learn==1.4.1.post1
scipy==1.12.0
seaborn==0.13.2
selenium==4.18.1
six==1.16.0
smmap==5.0.1
sniffio==1.3.1
sortedcontainers==2.4.0
SQLAlchemy==2.0.28
sqlparse==0.4.4
stack-data==0.6.3
starlette==0.36.3
threadpoolctl==3.3.0
tomli==2.0.1
tornado==6.4
traitlets==5.14.2
trio==0.25.0
trio-websocket==0.11.1
typing_extensions==4.10.0
tzdata==2024.1
urllib3==2.2.1
wcwidth==0.2.13
Werkzeug==3.0.1
wsproto==1.2.0
zipp==3.18.1
107 changes: 107 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# This workflow will run tests :
# Container tests (streamlit & API)
# API tests (unit tests)
# Data pipeline tests (unit tests)

name: Python application

on:
push:
branches: ["prod_version"]
pull_request:
branches: ["prod_version"]
schedule:
- cron: '30 20 * * 5' # Friday 20:30

permissions:
contents: read

jobs:
container_tests:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Create common network
run: docker network create common_network

- name: Build API image
uses: docker/build-push-action@v2
with:
context: ./src/api
file: ./src/api/Dockerfile.api
push: false
tags: paris_sportifs_api:latest

- name: Start API container
run: |
cd ./src/api
docker-compose -f docker-compose_api.yaml up -d
cd ../../
sleep 15
- name: Build Streamlit image
uses: docker/build-push-action@v2
with:
context: ./src/streamlit
file: ./src/streamlit/Dockerfile.streamlit
push: false
tags: paris_sportifs_streamlit:latest

- name: Start Streamlit container
run: |
cd ./src/streamlit
docker-compose -f docker-compose_streamlit.yaml up -d
cd ../../
sleep 15
data_ml_functions_tests:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./.github/workflows/requirements_pytest.txt
- name: Run tests
run: |
cd ./src/data_ml_functions
pytest unit_test.py
api_tests:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./.github/workflows/requirements_pytest.txt
- name: Run tests
run: |
cd ./src/api
pytest unit_test.py

0 comments on commit 63b5eff

Please sign in to comment.