-
Notifications
You must be signed in to change notification settings - Fork 32
149 lines (137 loc) · 4.45 KB
/
run-tests.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
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-tests-edge:
runs-on: windows-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Run Edge Robot Tests
uses: nick-fields/retry@v3.0.0
with:
timeout_minutes: 15
max_attempts: 10
command: robot -i Edge --output reports/outputEdge.xml test
new_command_on_retry: sleep 30; robot --rerunfailed "reports/outputEdge.xml" -i Edge --output reports/outputEdge.xml test
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: reportsEdge${{ matrix.python-version }}
path: reports
run-tests-chrome:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12']
include:
- os: ubuntu-latest
set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install mock
sudo apt-get update
sudo apt-get -y -q install xvfb scrot zip curl libxml2-dev libxslt1-dev
- name: Run Chrome Robot Tests
uses: nick-fields/retry@v3.0.0
with:
timeout_minutes: 15
max_attempts: 10
command: |
${{ matrix.set_display }}
robot -e BrokenORWindowsOREdge --output reports/outputChrome.xml test
new_command_on_retry: |
${{ matrix.set_display }}
robot --rerunfailed "reports/outputChrome.xml" -e BrokenORWindowsOREdge --output reports/outputChrome.xml test
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: reportsChrome${{ matrix.python-version }}
path: reports
run-tests-unit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install coveralls mock pytest-cov
sudo apt-get update
- name: Run Unit Tests
run: |
pytest --cov-config=.coveragerc --cov=src -v
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
flag-name: run-${{ matrix.python-version }}
parallel: true
run: |
coveralls --service=github
generate_report:
permissions:
actions: write
issues: write
discussions: write
pull-requests: write
if: always()
needs: [run-tests-chrome, run-tests-edge]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download reportsChrome
uses: actions/download-artifact@v3
with:
name: reportsChrome
path: reports
- name: Download reportsEdge
uses: actions/download-artifact@v3
with:
name: reportsEdge
path: reports
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install robotframework
- name: combine reports
run: rebot -o reports/output.xml reports/*.xml
- name: Send report to commit
uses: joonvena/robotframework-reporter-action@v2.4
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
show_passed_tests: false