-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (102 loc) · 4.34 KB
/
develop.yml
File metadata and controls
107 lines (102 loc) · 4.34 KB
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
103
104
105
106
107
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
branches: [ develop ]
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup PostgreSQL
# You may pin to the exact commit or the version.
# uses: Harmon758/postgresql-action@0be19fa37850b22cb4c9bbf28a03abbf44abd863
uses: Harmon758/postgresql-action@v1.0.0
with:
# POSTGRES_DB - name for the default database that is created
postgresql db: ${{ secrets.POSTGRES_DB }} # optional, default is
# POSTGRES_USER - create the specified user with superuser power
postgresql user: ${{ secrets.POSTGRES_USER }} # optional, default is
# POSTGRES_PASSWORD - superuser password
postgresql password: ${{ secrets.POSTGRES_PASSWORD }} # optional, default is
# Runs a single command using the runners shell
- uses: nijel/rabbitmq-action@v1.0.0
with:
rabbitmq version: '3.8.2-management-alpine'
- uses: actions/checkout@v2
- name: Configure DB
run: |
psql -U postgres -d postgresql://postgres@localhost/postgres -a -f ./db/stock_dashboard/CREATE_DB.sql
psql -U postgres -d postgresql://postgres@localhost/postgres -a -f ./db/stock_dashboard/INSERT_DATA.sql
env:
PGPASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install --upgrade pylint
- name: Tests
run: |
pytest
coverage run -m pytest
env:
LOGGING_CONF: ${{ secrets.LOGGING_CONF }}
PYTHONPATH: ${{ secrets.PYTHONPATH }}
RABBITMQ_ERLANG_COOKIE: ${{ secrets.RABBITMQ_ERLANG_COOKIE }}
RABBITMQ_CONNECTION_HOST: ${{ secrets.RABBITMQ_CONNECTION_HOST }}
RABBITMQ_DELIVERY_MODE: ${{ secrets.RABBITMQ_DELIVERY_MODE }}
MINCONN: ${{ secrets.MINCONN }}
MAXCONN: ${{ secrets.MAXCONN }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }}
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
MAIL_PORT: ${{ secrets.MAIL_PORT }}
MAIL_HOST: ${{ secrets.MAIL_HOST }}
MAIL_USE_TLS: ${{ secrets.MAIL_USE_TLS }}
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }}
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }}
PROD_ROOT: ${{ secrets.PROD_ROOT }}
FLASK_SECRET_KEY: ${{ secrets.FLASK_SECRET_KEY }}
FLASK_APP: ${{ secrets.FLASK_APP }}
APPLICATION_HOST: ${{ secrets.APPLICATION_HOST }}
TEMPLATE_ROOT: ${{ secrets.TEMPLATE_ROOT }}
FLASK_DEVELOPMENT_CONFIG: ${{ secrets.FLASK_DEVELOPMENT_CONFIG }}
FLASK_PRODUCTION_CONFIG: ${{ secrets.FLASK_PRODUCTION_CONFIG }}
FLASK_STAGING_CONFIG: ${{ secrets.FLASK_STAGING_CONFIG }}
FLASK_TESTING_CONFIG: ${{ secrets.FLASK_TESTING_CONFIG }}
- name: Pylint
run: pylint --rcfile=.pylintrc stock_dashboard_api workers --fail-under=9
- name: Upload coverage data to coveralls.io
run: |
pip install coveralls
coveralls --service=github --rcfile=.coveragerc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}