-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (102 loc) · 3.83 KB
/
build.yml
File metadata and controls
129 lines (102 loc) · 3.83 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: process-tracker-python
on:
push:
pull_request:
jobs:
postgresql-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- name: checkout repo code
uses: actions/checkout@v2
- name: create app directory
run: mkdir ${GITHUB_WORKSPACE}/.process_tracker
- name: place config file
run: cp ${GITHUB_WORKSPACE}/configs/process_tracker_config_dev.ini ${GITHUB_WORKSPACE}/.process_tracker/process_tracker_config_dev.ini
- name: install python
uses: gabrielfalcao/pyenv-action@v7
with:
default: 3.8.6
command: pip install -U pip
- name: install pipenv
run: pip install pipenv
- name: install cython (dependency)
run: pip install cython
- name: install requirements
run: pipenv install --dev
- name: run postgresql account creation
run: psql -f ${GITHUB_WORKSPACE}/dbscripts/postgresql_account_create.sql -U postgres -h localhost
env:
PGPASSWORD: postgres
- name: run postgresql database creation
run: psql -f ${GITHUB_WORKSPACE}/dbscripts/postgresql_process_tracker.sql process_tracker -U postgres -h localhost
env:
PGPASSWORD: postgres
- name: run postgresql database defaults creation
run: psql -f ${GITHUB_WORKSPACE}/dbscripts/postgresql_process_tracker_defaults.sql process_tracker -U postgres -h localhost
env:
PGPASSWORD: postgres
- name: run test suite
run: pipenv run python -m unittest discover tests
- name: Coveralls Results
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
github-token: ${{ secrets.github_token }}
flag-name: Unit Test
mysql-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
ports:
- 3306:3306
steps:
- name: checkout repo code
uses: actions/checkout@v2
- name: create app directory
run: mkdir ${GITHUB_WORKSPACE}/.process_tracker
- name: place config file
run: cp ${GITHUB_WORKSPACE}/configs/process_tracker_config_dev.ini ${GITHUB_WORKSPACE}/.process_tracker/process_tracker_config_dev.ini
- name: install python
uses: gabrielfalcao/pyenv-action@v7
with:
default: 3.8.6
command: pip install -U pip
- name: install pipenv
run: pip install pipenv
- name: install cython (dependency)
run: pip install cython
- name: install requirements
run: pipenv install --dev
- name: run mysql account creation
run: mysql -u root -h 127.0.0.1 < ${GITHUB_WORKSPACE}/dbscripts/mysql_account_create.sql
- name: run mysql database creation
run: mysql -u root -h 127.0.0.1 < ${GITHUB_WORKSPACE}/dbscripts/mysql_process_tracker.sql
- name: run mysql database defaults creation
run: mysql -u root -h 127.0.0.1 < ${GITHUB_WORKSPACE}/dbscripts/mysql_process_tracker_defaults.sql
- name: run test suite
run: pipenv run python -m unittest discover tests
- name: Coveralls Results
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
github-token: ${{ secrets.github_token }}
flag-name: Unit Test
finish:
needs: [mysql-test, postgresql-test]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true