-
Notifications
You must be signed in to change notification settings - Fork 1
220 lines (185 loc) · 5.81 KB
/
python-app.yml
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Project Poseidon
on:
push:
branches: [ "master", "dev_sroy", "poc_sroy", "23-add-docker-files" ]
pull_request:
branches: [ "master" ]
#schedule: ## At every 30th minute past every hour from 2 through 10. Schedule the job to run at 4.am daily. '0 4 * * *'
# - cron: '*/30 2-10 * * *'
permissions:
contents: write
jobs:
ubuntu-youtube-catapi-tests:
name: Ubuntu - Test Youtube & Cat API
runs-on: ubuntu-latest
steps:
- name: Checking out
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install the browsers for playwright
run: |
python -m playwright install --with-deps
- name: Test with pytest
env:
CAT_API_KEY: ${{ secrets.CAT_API_KEY }}
run: |
pytest web/src/test/testcases/youtube
pytest api/src/test/testcases/catAPI
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-ubuntu
path: allure-results/*
retention-days: 1
windows-youtube-catapi-tests:
name: Windows - Test Youtube & Cat API
runs-on: windows-latest
if: always()
needs: [ ubuntu-youtube-catapi-tests ]
steps:
- name: Checking out
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install the browsers for playwright
shell: pwsh
run: |
python -m playwright install --with-deps
- name: Test with pytest
shell: pwsh
env:
CAT_API_KEY: ${{ secrets.CAT_API_KEY }}
run: |
pytest api/src/test/testcases/catAPI
pytest web/src/test/testcases/youtube
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-windows
path: allure-results/*
retention-days: 1
macos-youtube-catapi-tests:
name: MacOS - Test Youtube & Cat API
runs-on: macos-latest
if: always()
needs: [ windows-youtube-catapi-tests ]
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install the browsers for playwright
run: |
python -m playwright install --with-deps
- name: Test with pytest
env:
CAT_API_KEY: ${{ secrets.CAT_API_KEY }}
run: |
pytest api/src/test/testcases/catAPI
pytest web/src/test/testcases/youtube
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-macos
path: allure-results
retention-days: 1
generate-allure-report:
name: Generate Allure Report
runs-on: ubuntu-latest
if: always()
needs: [ macos-youtube-catapi-tests ]
steps:
- name: Download Artifacts from Ubuntu
uses: actions/download-artifact@v4
id: download-ubuntu
with:
name: allure-results-ubuntu
path: allure-results-ubuntu
- name: Download Artifacts from Windows
uses: actions/download-artifact@v4
id: download-windows
with:
name: allure-results-windows
path: allure-results-windows
- name: Download Artifacts from MacOS
uses: actions/download-artifact@v4
id: download-macos
with:
name: allure-results-macos
path: allure-results-macos
- name: Copy Allure-Result Files from Ubuntu
uses: canastro/copy-file-action@master
with:
source: allure-results-ubuntu/.
target: allure-results/
flags: '-r'
- name: Copy Allure-Result Files from Windows
uses: canastro/copy-file-action@master
with:
source: allure-results-windows/.
target: allure-results/
flags: '-r'
- name: Copy Allure-Result Files from MacOS
uses: canastro/copy-file-action@master
with:
source: allure-results-macos/.
target: allure-results/
flags: '-r'
- name: Allure gh-page Checkout
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Setting Allure-Report Action
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages
allure_report: allure-report
allure_history: allure-history
keep_reports: 20
- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
# - name: Post the link to the report
# if: always()
# uses: Sibz/github-status-action@v1
# with:
# authToken: ${{secrets.GITHUB_TOKEN}}
# context: 'Test report'
# state: 'success'
# sha: ${{ github.event.pull_request.head.sha }}
# target_url: simple-elf.github.io/github-allure-history/${{ github.run_number }}