Repository navigation
152 lines (124 loc) · 4.05 KB
/
Copy pathci.yml
File metadata and controls
152 lines (124 loc) · 4.05 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
name: CI Tests
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
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 -e ".[dev]"
- name: Run tests
run: |
pytest -m "rest or graphql or grpc" --alluredir=reports/allure-results
- name: Install Allure CLI
if: always()
run: |
wget -q https://github.com/allure-framework/allure2/releases/download/2.24.1/allure-2.24.1.tgz
tar -xzf allure-2.24.1.tgz
sudo mv allure-2.24.1 /opt/allure
sudo ln -s /opt/allure/bin/allure /usr/local/bin/allure
- name: Generate Allure report
if: always()
run: |
allure generate reports/allure-results --clean -o reports/allure-report || true
- name: Upload Allure results
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-${{ matrix.python-version }}
path: reports/allure-results
retention-days: 30
- name: Upload Allure report
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-report-${{ matrix.python-version }}
path: reports/allure-report
retention-days: 30
integration:
name: Kafka & PostgreSQL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL and Kafka
run: docker compose up -d --wait --wait-timeout 180
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run Kafka and database tests
run: |
pytest -m "kafka or database" --alluredir=reports/allure-results
- name: Show service logs on failure
if: failure()
run: docker compose logs --tail=200
- name: Upload Allure results
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-integration
path: reports/allure-results
retention-days: 30
publish-pages:
needs: [test, integration]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Download Allure results
uses: actions/download-artifact@v4
with:
pattern: allure-results-*
merge-multiple: true
path: reports/allure-results
- name: Install Allure CLI
run: |
wget -q https://github.com/allure-framework/allure2/releases/download/2.24.1/allure-2.24.1.tgz
tar -xzf allure-2.24.1.tgz
sudo mv allure-2.24.1 /opt/allure
sudo ln -s /opt/allure/bin/allure /usr/local/bin/allure
- name: Generate Allure report
run: |
allure generate reports/allure-results --clean -o reports/allure-report
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: reports/allure-report
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4