-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (152 loc) · 4.83 KB
/
development.yml
File metadata and controls
178 lines (152 loc) · 4.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Development Pipeline - Automatically triggered
# Runs on pushes to develop branch and pull requests to main
# Includes testing, linting, and development Docker builds
name: Development Pipeline
on:
push:
branches:
- develop
- feature/*
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
pull_request:
branches:
- main
- develop
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
env:
PYTHON_VERSION: "3.11"
NODE_VERSION: "18"
jobs:
# Code Quality and Security Checks
quality-checks:
name: Code Quality & Security
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run linting (flake8)
run: flake8 app/ src/ --max-line-length=100 --ignore=E203,W503
continue-on-error: true
- name: Run security scan (bandit)
run: bandit -r app/ src/ -f json -o bandit-report.json
continue-on-error: true
- name: Upload security report
uses: actions/upload-artifact@v4
if: always()
with:
name: security-report
path: bandit-report.json
# Comprehensive Testing Suite
test-suite:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
test-type: ["unit", "integration", "e2e"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
if [ "${{ matrix.test-type }}" == "e2e" ]; then
playwright install --with-deps
fi
- name: Run tests
run: |
case "${{ matrix.test-type }}" in
"unit")
pytest tests/unit --cov=app --cov-report=xml --cov-report=html
;;
"integration")
pytest tests/integration --cov=app --cov-append --cov-report=xml
;;
"e2e")
pytest tests/e2e
;;
esac
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: matrix.test-type != 'e2e'
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.test-type }}
path: |
coverage.xml
htmlcov/
# Docker Development Build
docker-dev-build:
name: Docker Development Build
runs-on: ubuntu-latest
needs: [quality-checks, test-suite]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build development image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
target: development
push: false
tags: |
skb-visualization:dev-${{ github.sha }}
skb-visualization:dev-latest
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_DATE=${{ github.event.head_commit.timestamp }}
GIT_COMMIT=${{ github.sha }}
GIT_BRANCH=${{ github.ref_name }}
- name: Test Docker container
run: |
docker run --rm -d -p 5000:5000 --name test-container skb-visualization:dev-latest
sleep 10
curl -f http://localhost:5000/health || exit 1
docker stop test-container
# Development Summary
development-summary:
name: Development Summary
runs-on: ubuntu-latest
needs: [quality-checks, test-suite, docker-dev-build]
if: always()
steps:
- name: Create development summary
run: |
cat >> $GITHUB_STEP_SUMMARY << EOF
## 🚀 Development Pipeline Summary
**Branch**: ${{ github.ref_name }}
**Commit**: ${{ github.sha }}
**Triggered by**: ${{ github.event_name }}
### Test Results
- **Quality Checks**: ${{ needs.quality-checks.result }}
- **Test Suite**: ${{ needs.test-suite.result }}
- **Docker Build**: ${{ needs.docker-dev-build.result }}
### Next Steps
- ✅ All checks passed - Ready for code review
- 🔍 Review any linting or security warnings
- 🧪 Verify test coverage is adequate
EOF