@@ -31,11 +31,15 @@ jobs:
3131 restore-keys : |
3232 ${{ runner.os }}-pip-
3333
34+ - name : Install UV
35+ run : |
36+ curl -LsSf https://astral.sh/uv/install.sh | sh
37+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
38+
3439 - name : Install dependencies
3540 run : |
36- python -m pip install --upgrade pip
37- pip install -r requirements.txt
38- pip install pytest pytest-cov pytest-asyncio httpx
41+ uv venv --python ${{ matrix.python-version }}
42+ uv pip install -e ".[dev,test]"
3943
4044 - name : Set up test environment
4145 run : |
@@ -50,19 +54,19 @@ jobs:
5054
5155 - name : Run security tests
5256 run : |
53- python -m pytest tests/test_security.py -v --tb=short
57+ uv run pytest tests/test_security.py -v --tb=short
5458
5559 - name : Run API tests
5660 run : |
57- python -m pytest tests/test_api.py -v --tb=short
61+ uv run pytest tests/test_api.py -v --tb=short
5862
5963 - name : Run enhanced API tests
6064 run : |
61- python -m pytest tests/test_api_enhanced.py -v --tb=short
65+ uv run pytest tests/test_api_enhanced.py -v --tb=short
6266
6367 - name : Run full test suite with coverage
6468 run : |
65- python -m pytest tests/ -v --cov=. --cov-report=xml --cov-report=term-missing --tb=short
69+ uv run pytest tests/ -v --cov=. --cov-report=xml --cov-report=term-missing --tb=short
6670
6771 - name : Upload coverage to Codecov
6872 uses : codecov/codecov-action@v3
@@ -85,28 +89,32 @@ jobs:
8589 with :
8690 python-version : 3.11
8791
92+ - name : Install UV
93+ run : |
94+ curl -LsSf https://astral.sh/uv/install.sh | sh
95+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
96+
8897 - name : Install linting dependencies
8998 run : |
90- python -m pip install --upgrade pip
91- pip install flake8 black isort mypy
92- pip install -r requirements.txt
99+ uv venv --python 3.11
100+ uv pip install -e ".[dev,test]"
93101
94102 - name : Run flake8
95103 run : |
96- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
97- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
104+ uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
105+ uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
98106
99107 - name : Check code formatting with black
100108 run : |
101- black --check --diff .
109+ uv run black --check --diff .
102110
103111 - name : Check import sorting with isort
104112 run : |
105- isort --check-only --diff .
113+ uv run isort --check-only --diff .
106114
107115 - name : Type checking with mypy
108116 run : |
109- mypy . --ignore-missing-imports --no-strict-optional
117+ uv run mypy . --ignore-missing-imports --no-strict-optional
110118 continue-on-error : true
111119
112120 security :
@@ -122,20 +130,25 @@ jobs:
122130 with :
123131 python-version : 3.11
124132
133+ - name : Install UV
134+ run : |
135+ curl -LsSf https://astral.sh/uv/install.sh | sh
136+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
137+
125138 - name : Install security dependencies
126139 run : |
127- python -m pip install --upgrade pip
128- pip install bandit safety
129- pip install -r requirements.txt
140+ uv venv --python 3.11
141+ uv pip install -e ".[dev,test]"
142+ uv pip install bandit safety
130143
131144 - name : Run bandit security scan
132145 run : |
133- bandit -r . -f json -o bandit-report.json
146+ uv run bandit -r . -f json -o bandit-report.json
134147 continue-on-error : true
135148
136149 - name : Run safety check
137150 run : |
138- safety check --json --output safety-report.json
151+ uv run safety check --json --output safety-report.json
139152 continue-on-error : true
140153
141154 - name : Upload security reports
@@ -220,11 +233,15 @@ jobs:
220233 with :
221234 python-version : 3.11
222235
236+ - name : Install UV
237+ run : |
238+ curl -LsSf https://astral.sh/uv/install.sh | sh
239+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
240+
223241 - name : Install dependencies
224242 run : |
225- python -m pip install --upgrade pip
226- pip install -r requirements.txt
227- pip install pytest pytest-asyncio httpx
243+ uv venv --python 3.11
244+ uv pip install -e ".[dev,test]"
228245
229246 - name : Set up integration test environment
230247 run : |
@@ -235,13 +252,13 @@ jobs:
235252
236253 - name : Run integration tests
237254 run : |
238- DATABASE_URL=postgresql://testuser:testpass@localhost:5432/jmeter_test python -m pytest tests/test_api.py tests/test_security.py -v --tb=short
255+ DATABASE_URL=postgresql://testuser:testpass@localhost:5432/jmeter_test uv run pytest tests/test_api.py tests/test_security.py -v --tb=short
239256
240257 - name : Test application startup
241258 run : |
242259 export ENVIRONMENT=development
243260 export DATABASE_URL=sqlite:///./startup_test.db
244- timeout 30s python main.py &
261+ timeout 30s uv run python main.py &
245262 sleep 5
246263 # Test health endpoint - accept both 200 and 503 (some services may be unavailable in CI)
247264 HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/health)
@@ -250,7 +267,7 @@ jobs:
250267 exit 1
251268 fi
252269 echo "✅ Health check passed with status: $HTTP_STATUS"
253- pkill -f "python main.py" || true
270+ pkill -f "uv run python main.py" || true
254271
255272 deployment-ready :
256273 name : Deployment Ready Check
0 commit comments