-
Notifications
You must be signed in to change notification settings - Fork 77
125 lines (125 loc) · 3.59 KB
/
test_code.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
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
name: "Code testing"
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
expression_blacklist:
name: expression blacklist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch origin master
- name: No "console.log" please
run: git diff origin/master -- "*.js" | grep "^[+][^+]" | grep -v "noqa" | grep "console.log" || exit 0 && exit 1
test_python_types:
name: python mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: install mypy==1.2.0
run: pip3 install mypy==1.2.0
- name: install requirements
run: pip3 install -r requirements.txt
- name: run mypy on main files
run: mypy src/app.py src/daemon.py
- name: run mypy on tests
run: MYPYPATH=src/ mypy src/tests/
- name: run mypy on utils
run: MYPYPATH=src/ mypy src/utils/
test_python_style:
name: python flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: install flake8==6.0.0
run: pip3 install flake8==6.0.0
- name: run flake8
run: flake8 src
test_python_lint:
name: python black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: install black
run: pip3 install black==22.3.0
- name: run black
run: black --check "src"
test_js_style:
name: js prettier
runs-on: ubuntu-latest
env:
working-directory: src/mqueryfront
steps:
- uses: actions/checkout@v2
- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: install prettier
run: npm install -g [email protected]
- name: run prettier
run: prettier --tab-width=4 --check "src/**/*.js"
test_js_build:
name: npm build
runs-on: ubuntu-latest
env:
working-directory: src/mqueryfront
steps:
- name: Setup nodejs
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: install dependencies
run: yarn install
- name: build
run: npm build
test_unit:
name: unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: build test image
run: docker build -t mquery_tests:latest -f src/tests/Dockerfile .
- name: run unit tests
run: docker run mquery_tests
test_e2e:
name: e2e tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: build test image
run: docker build -t mquery_tests:latest -f src/e2etests/Dockerfile .
- name: run web with docker compose
run: docker compose up --build -d web --wait
- name: init the database
run: docker compose exec -it -w /usr/src/app/src/ web alembic upgrade head
- name: run the rest of the code
run: docker compose up -d
- name: run e2e tests
run: docker run --net mquery_default -v $(readlink -f ./samples):/mnt/samples mquery_tests
- name: get run logs
if: always()
run: docker compose logs
- name: stop docker compose
if: always()
run: docker compose down