-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.yml
More file actions
48 lines (40 loc) · 1.09 KB
/
ci.yml
File metadata and controls
48 lines (40 loc) · 1.09 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
# Поднимаем контейнер Petstore как сервис
services:
petstore:
image: swaggerapi/petstore3:latest
ports:
- 8080:8080
options: >-
--health-cmd "curl -f http://localhost:8080/api/v3/openapi.json || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Wait for Petstore to be healthy
run: |
for i in {1..5}; do
curl -f http://localhost:8080/api/v3/openapi.json && break
echo "Waiting for Petstore..."
sleep 5
done
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: pytest -q