-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (81 loc) · 2.81 KB
/
pytest.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
name: Pytest
env:
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_DATABASE: ${{ secrets.POSTGRES_DATABASE }}
APPLY_MIGRATIONS: ${{ secrets.APPLY_MIGRATIONS }}
ALEMBIC_CONFIG: ${{ secrets.ALEMBIC_CONFIG }}
MONGODB_HOST: ${{ secrets.MONGODB_HOST }}
MONGODB_USERNAME: ${{ secrets.MONGODB_USERNAME }}
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD }}
MINIO_HOST: ${{ secrets.MINIO_HOST }}
MINIO_PORT: ${{ secrets.MINIO_PORT }}
MINIO_SECURE: ${{ secrets.MINIO_SECURE }}
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
MINIO_APP_USER_ACCESS_KEY: ${{ secrets.MINIO_APP_USER_ACCESS_KEY }}
MINIO_APP_USER_SECRET_KEY: ${{ secrets.MINIO_APP_USER_SECRET_KEY }}
MINIO_BUCKET_NAME: ${{ secrets.MINIO_BUCKET_NAME }}
on: [push]
jobs:
run_pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
services:
minio:
image: minio/minio:edge-cicd
ports:
- 9000:9000
env:
MINIO_ROOT_USER: personifydev
MINIO_ROOT_PASSWORD: testenv123
options: --health-cmd "curl -s http://localhost:9000/minio/health/live"
postgres-db:
image: postgres
env:
POSTGRES_PASSWORD: testenv123
POSTGRES_USER: personifydev
POSTGRES_DB: personify
ports:
- 5432:5432
mongo-db:
image: mongo
env:
MONGO_INITDB_ROOT_USERNAME: personifydev
MONGO_INITDB_ROOT_PASSWORD: testenv123
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Display Python Version
run: python -c "import sys; print(sys.version)"
- name: Updrade Pip
run: python -m pip install --upgrade pip
- name: Install Requirements
run: pip install -r requirements.txt
- name: Install required packages along with Pytest
run: pip install pytest pytest-cov pytest-asyncio pytest-dotenv
- name: Running tests with Code Coverage
run: pytest -vv --junitxml=coverage.xml --cov --cov-report=term-missing
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Running tests with Code Coverage
coveralls_finish:
needs: run_pytest
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
path-to-lcov: coverage.xml