-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (130 loc) · 4.14 KB
/
test.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
126
127
128
129
130
131
132
133
134
135
136
name: Test Pipeline
on: [push, pull_request]
jobs:
test-cab_common:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
cd backend/cab_common
export PYTHONPATH=.
pip install -r requirements.txt
- name: Run tests
run: |
cd backend/cab_common
pytest tests --cov --cov-report term --cov-report html --cov-report xml:coverage.xml --junitxml=report.xml
env:
COV_CONTEXT: "backend/cab_common"
test-event-service:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install backend/cab_common
cd backend/event-service
pip install -r requirements.txt
- name: Run tests
run: |
cd backend/event-service
export PYTHONPATH=.
export FLASK_APP=web
pytest tests --cov --cov-report term --cov-report html --cov-report xml:coverage.xml --junitxml=report.xml
env:
COV_CONTEXT: "backend/event-service"
test-context-service:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install backend/cab_common
cd backend/context-service
pip install -r requirements.txt
pip install pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-runner==6.0.1
- name: Run tests
run: |
cd backend/context-service
export PYTHONPATH=.
export FLASK_APP=web
pytest tests --cov --cov-report term --cov-report html --cov-report xml:coverage.xml --junitxml=report.xml
env:
COV_CONTEXT: "backend/context-service"
test-recommendation-service:
runs-on: ubuntu-latest
container: python:3.11.6-slim
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up dependencies
run: |
mkdir -p /usr/share/man/man1
apt update && apt install -y --no-install-recommends default-jre
pip install backend/cab_common
- name: Set up recommendation service
run: |
cd backend/recommendation-service
pip install -r requirements.txt
pip install pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-runner==6.0.1
- name: Run tests
run: |
cd backend/recommendation-service
export PYTHONPATH=.
export FLASK_APP=web
pytest tests --cov --cov-report term --cov-report html --cov-report xml:coverage.xml --junitxml=report.xml
env:
COV_CONTEXT: "backend/recommendation-service"
test-frontend-service:
runs-on: ubuntu-latest
container: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install dependencies
run: |
cd frontend
npm ci
- name: Lint code
run: |
cd frontend
npm run lint
- name: Type-check code
run: |
cd frontend
npm run type-check
- name: Build project
run: |
cd frontend
npm run build-only
- name: Run tests
run: |
cd frontend
npm run test:coverage
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v3
with:
name: frontend-coverage
path: frontend/coverage
env:
COV_CONTEXT: "frontend"