-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (107 loc) · 3.54 KB
/
fe_e2e.yml
File metadata and controls
127 lines (107 loc) · 3.54 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
name: E2E + SonarQube
on:
push:
branches: [main]
pull_request:
jobs:
run-python-app:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
DB_URL: ${{ secrets.DB_URL }}
REDIS_HOST: localhost
REDIS_PORT: 6379
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
QDRANT_URL: http://localhost:6333
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
steps:
- uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
# Set up Docker Compose (run on root)
- name: Set up Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
# Start containers
- name: Run docker-compose
run: docker-compose -f docker-compose.yml up -d
# Wait for services
- name: Wait for services
run: sleep 5
# install backend dependencies
- name: Install dependencies
run: pip install -r requirements.txt
working-directory: backend
# Create Tables
- name: Create DB Tables
run: python tables.py
working-directory: backend/setup_tables
# Run All Services
- name: Run all services
run: |
python backend/ai_analyze_service/app.py &
python backend/auth_service/app.py &
python backend/notes_crud_service/app.py &
# Wait for services
- name: Wait for services
run: sleep 20
# Set up Node
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
# Install frontend dependencies
- name: Install dependencies
run: npm ci
working-directory: frontend
# Build app (with coverage instrumentation)
- name: Build React app with coverage
run: npm run build
working-directory: frontend
# Start the app in background
- name: Start React app
run: npm run dev &
working-directory: frontend
- name: Wait for server
run: npx wait-on http://localhost:5173
working-directory: frontend
# install playwright browsers
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: frontend
# Run Playwright tests
- name: Run Playwright tests
run: npm run test:e2e-coverage
working-directory: frontend
continue-on-error: true
# Upload coverage as artifacts
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage
path: frontend/coverage/
# Upload test reports as artifacts
- name: Upload test report artifacts
uses: actions/upload-artifact@v4
with:
name: test-reports
path: frontend/playwright-report/
# SonarQube Analysis
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5
with:
projectBaseDir: frontend
args: >
-Dsonar.projectKey=NavodPeiris_NoteMaker
-Dsonar.organization=navodpeiris
-Dsonar.language=ts
-Dsonar.sources=./src
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.exclusions=**/node_modules/**,**/backend/**,**/postgres_data/**,**/qdrant_data/**,**/redis_data/**,**/.vscode/**,**/.nyc_output/**
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}