-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (117 loc) · 3.3 KB
/
build.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
name: build
on:
pull_request:
push:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install depedencies
run: |
pip install poetry
poetry install --no-ansi
- uses: pre-commit/[email protected]
unit:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install depedencies
run: |
pip install poetry
poetry install --no-ansi
- name: unit tests
run: |
poetry run coverage run -m pytest --junit-xml=output/unit-tests.xml
- name: package results
if: always()
run: |
mkdir -p output
mv .coverage.* output/
tar cvfz output.tgz output
- name: save output
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-tests
path: output.tgz
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: "unit results"
files: |
output/unit-tests.xml
cucu:
needs: unit
runs-on: ubuntu-latest
strategy:
matrix:
browser: ["chrome", "firefox", "edge"]
permissions: # to publish junit results - see https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#permissions
contents: read
issues: read
checks: write
pull-requests: write
services:
webserver:
image: selenium/standalone-${{ matrix.browser }}:124.0
ports:
- 4444:4444
options: --shm-size=4gb
env:
SE_NODE_MAX_SESSIONS: 12
SE_NODE_SESSION_TIMEOUT: 300
SCREEN_WIDTH: 1366
SCREEN_HEIGHT: 768
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install depedencies
run: |
pip install poetry
poetry install --no-ansi
- name: wait_for_selenium
# retry connection every 2s x 60 which is a total of 2 minutes
run: curl --retry 60 --retry-delay 2 --retry-connrefused http://localhost:4444
- name: UI tests
run: |
poetry run cucu run features --browser "${{ matrix.browser }}" --workers 1 --generate-report --report output/report --junit output/junit --selenium-remote-url http://localhost:4444
env:
COVERAGE_PROCESS_START: pyproject.toml
SE_NODE_MAX_SESSIONS: 12
SE_NODE_SESSION_TIMEOUT: 300
SCREEN_WIDTH: 1366
SCREEN_HEIGHT: 768
DISPLAY: :99 # Needed for headless mode
SELENIUM_HOST: localhost
SELENIUM_PORT: 4444
- name: package results
if: always()
run: |
mkdir -p output
mv .coverage.* output/
tar cvfz output.tgz output
- name: save output
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}-tests
path: output.tgz
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: "${{ matrix.browser }} results"
files: |
output/junit/**/*.xml