-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (95 loc) · 2.61 KB
/
tests.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
name: Testing identity_socializer
on: push
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run black check
run: poetry run black --check .
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run flake8 check
run: poetry run flake8 --count .
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run mypy check
run: poetry run mypy .
pytest:
runs-on: ubuntu-latest
services:
identity_socializer-db:
image: postgres:13.8-bullseye
env:
POSTGRES_PASSWORD: identity_socializer
POSTGRES_USER: identity_socializer
POSTGRES_DB: identity_socializer
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Firebase credentials for testing
run: echo "$FIREBASE_CREDENTIALS" > firebase_credentials.json
shell: bash
env:
FIREBASE_CREDENTIALS: ${{secrets.FIREBASE_CREDENTIALS}}
- name: Run pytest check
run: poetry run pytest -vv --cov="identity_socializer" --cov-config .coveragerc .
env:
IDENTITY_SOCIALIZER_HOST: "0.0.0.0"
IDENTITY_SOCIALIZER_DB_HOST: localhost
devflow:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- name: checkout
uses: actions/checkout@master
- uses: okteto/context@latest
with:
token: ${{ secrets.OKTETO_TOKEN }}
- name: "Create deployment"
uses: luiscusihuaman/okteto-deploy@main
with:
file: okteto.yml
build: "true"