Repository navigation
102 lines (85 loc) · 2.74 KB
/
Copy pathci.yml
File metadata and controls
102 lines (85 loc) · 2.74 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
name: CloudMonitor CI
on:
push:
branches:
- main
- master
- cloudmonitor-integration
pull_request:
branches:
- main
- master
- cloudmonitor-integration
workflow_dispatch:
permissions:
contents: read
jobs:
backend-test:
name: Backend & Agent Test Suite
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
backend/requirements.txt
agent/requirements.txt
- name: Install backend and agent dependencies
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements.txt
pip install -r agent/requirements.txt
- name: Run Python test suite
env:
APP_ENV: "test"
JWT_SECRET_KEY: "ci_test_secret_key_at_least_32_characters_long_for_tests"
DATABASE_URL: "sqlite:///./test.db"
run: |
PYTHONPATH=backend:. pytest -v --tb=short tests/ agent/tests/
frontend-build:
name: Frontend Build & Asset Verification
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Build production bundle
working-directory: frontend
run: npm run build
- name: Verify build outputs exist
run: |
test -f frontend/dist/index.html
echo "Frontend build successfully generated dist/index.html"
docker-compose-validate:
name: Docker Compose Specification Validation
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Validate Local Compose File Syntax
run: |
docker compose -f docker-compose.yml config --quiet
echo "docker-compose.yml syntax is valid."
- name: Validate Production Compose File Syntax
env:
POSTGRES_PASSWORD: "placeholder_password_for_validation"
JWT_SECRET_KEY: "placeholder_jwt_secret_for_validation_at_least_32_chars"
DATABASE_URL: "postgresql://cloudmonitor:placeholder@postgres:5432/cloudmonitor"
run: |
docker compose -f docker-compose.prod.yml config --quiet
echo "docker-compose.prod.yml syntax is valid."